go/Dockerfile

27 lines
630 B
Docker
Raw Permalink Normal View History

2024-04-25 12:06:58 +00:00
FROM golang:1.22-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
2021-11-15 13:34:03 +00:00
ENV GOPRIVATE=go.pkg.cx
2019-07-21 19:52:51 +00:00
2024-08-07 12:18:16 +00:00
ENV GOLANGCI=1.59.1
2019-02-02 12:04:44 +00:00
RUN \
2024-05-21 11:20:30 +00:00
apk add --no-cache --update bash curl git tzdata && \
rm -rf /var/cache/apk/*
2019-02-02 12:04:44 +00:00
RUN \
2024-05-21 11:20:30 +00:00
cp /usr/share/zoneinfo/${TZ} /etc/localtime && \
echo "${TZ}" > /etc/timezone && date
2019-02-02 12:04:44 +00:00
RUN \
2024-05-21 11:20:30 +00:00
# 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} && \
# cleanup
go clean -cache -modcache && \
# print versions
go version && \
golangci-lint --version