minimalist docker base image to build and deploy my services and applications.
Two images included:
artemkaxboy/baseimage:buildgo-latest. For build stage, includes go compiler and linters. Alpine based.artemkaxboy/baseimage:app-latestImage artemkaxboy/baseimage:buildgo-latest intends to be used in multi-stage Dockefile to build go applications and services.
CGO_ENABLED=0 and GOARCH=amd64coverage.sh script to report coverage.git-rev.sh script to make git-based version without full .git copied (works without .git/objects)Image artemkaxboy/baseimage:app-latest designed as a lightweight, ready-to-use base for various services.
It adds a few things to the regular alpine image.
ENTRYPOINT /init.sh runs CMD via dumb-initapp user with uid $APP_UID (default 1001)/srv/init.sh if provided by custom containertzdata, curl, su-exec, ca-certificates and openssl pre-installedapp (uid=1001)The container can be customized in runtime by setting environment from docker's command line or as a part of docker-compose.yml
TIME_ZONE - set container's TZ, default "Asia/Novosibirsk"APP_UID - UID of internal app user, default 1001FROM artemkaxboy/baseimage:buildgo as build
WORKDIR /build
ADD . /build
RUN go test -mod=vendor ./...
RUN golangci-lint run --out-format=tab --tests=false ./...
RUN \
revison=$(/script/git-rev.sh) && \
echo "revision=${revison}" && \
go build -mod=vendor -o app -ldflags "-X main.revision=$revison -s -w" .
FROM artemkaxboy/baseimage:app
COPY --from=build /build/app /srv/app
EXPOSE 8080
WORKDIR /srv
CMD ["/srv/app", "param1", "param2]
It will make a container running "/srv/app" (with passed params) under 'app' user.
To customize both TIME_ZONE and UID - docker run -e TIME_ZONE=America/New_York -e APP_UID=2000 <image>
Content type
Image
Digest
Size
3.7 MB
Last updated
about 7 years ago
docker pull artemkaxboy/baseimage