go/Dockerfile
Anton Zadvorny d50e92d484
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Set GOPRIVATE environment variable
2021-11-15 18:06:39 +03:00

34 lines
781 B
Docker

FROM golang:1.17-alpine
ENV TZ=Europe/Moscow
ENV TERM=xterm-color
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
ENV GO111MODULE=on
ENV GOPRIVATE=go.pkg.cx
ENV GOLANGCI=1.43.0
ENV GOSWAG=1.7.4
RUN \
apk add --no-cache --update bash curl git tzdata && \
rm -rf /var/cache/apk/*
RUN \
cp /usr/share/zoneinfo/${TZ} /etc/localtime && \
echo "${TZ}" > /etc/timezone && date
RUN \
# install golangci-lint
go install -v -ldflags "-X 'main.version=${GOLANGCI}' -X 'main.date=$(date)'" github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCI} && \
# install goswag
go install -v github.com/swaggo/swag/cmd/swag@v${GOSWAG} && \
# cleanup
go clean -cache -modcache && \
# print versions
go version && \
golangci-lint --version && \
swag --version