go/Dockerfile

38 lines
1.0 KiB
Docker
Raw Normal View History

2019-04-01 14:34:13 +00:00
FROM golang:1.12-alpine
2019-02-02 12:04:44 +00:00
ENV TZ=Europe/Moscow
ENV TERM=xterm-color
2019-07-21 19:52:51 +00:00
2019-02-02 12:04:44 +00:00
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
2019-07-21 19:52:51 +00:00
2019-06-29 10:47:19 +00:00
ENV GOLANGCI=1.17.1
2019-07-21 19:52:51 +00:00
ENV GOSWAG=1.6.2
2019-02-02 12:04:44 +00:00
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 \
2019-07-21 19:52:51 +00:00
# golangci install
2019-02-02 12:04:44 +00:00
go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint && \
cd /go/src/github.com/golangci/golangci-lint && \
git checkout v${GOLANGCI} && \
cd /go/src/github.com/golangci/golangci-lint/cmd/golangci-lint && \
go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" && \
2019-07-21 19:52:51 +00:00
# goswag install
go get -u -v github.com/swaggo/swag/cmd/swag && \
cd /go/src/github.com/swaggo/swag && \
git checkout v${GOSWAG} && \
cd /go/src/github.com/swaggo/swag/cmd/swag && \
go install && \
# show versions
2019-02-02 12:04:44 +00:00
go version && \
2019-07-21 19:52:51 +00:00
golangci-lint --version && \
swag --version