39 lines
1.0 KiB
Docker
39 lines
1.0 KiB
Docker
FROM golang:1.15-alpine
|
|
|
|
ENV TZ=Europe/Moscow
|
|
ENV TERM=xterm-color
|
|
|
|
ENV CGO_ENABLED=0
|
|
ENV GOOS=linux
|
|
ENV GOARCH=amd64
|
|
ENV GO111MODULE=on
|
|
|
|
ENV GOLANGCI=1.31.0
|
|
ENV GOSWAG=1.6.7
|
|
|
|
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 get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCI} && \
|
|
cd /go/pkg/mod/github.com/golangci/golangci-lint@v${GOLANGCI} && \
|
|
go install -ldflags "-X 'main.version=${GOLANGCI}' -X 'main.date=$(date)'" github.com/golangci/golangci-lint/cmd/golangci-lint && \
|
|
cd / && \
|
|
# install goswag
|
|
go get -u -v github.com/swaggo/swag/cmd/swag@v${GOSWAG} && \
|
|
cd /go/pkg/mod/github.com/swaggo/swag@v${GOSWAG} && \
|
|
go install github.com/swaggo/swag/cmd/swag && \
|
|
cd / && \
|
|
# cleanup
|
|
go clean -cache -modcache && \
|
|
# print versions
|
|
go version && \
|
|
golangci-lint --version && \
|
|
swag --version
|