From d3705d0e8b3ba14bce1c8050ac32a1548b3d1363 Mon Sep 17 00:00:00 2001 From: Darlez <79588890+Darlez@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:11:34 +0300 Subject: [PATCH] Build docker images with go1.17 (#2188) --- Makefile | 2 +- build/Dockerfile | 4 ++-- build/Dockerfile.alpine | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1887131f..1f94ecb6 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ fast_generate: assets/github-action-config.json fast_check_generated: $(MAKE) --always-make fast_generate - git checkout -- go.mod go.sum # can differ between go1.15 and go1.16 + git checkout -- go.mod go.sum # can differ between go1.16 and go1.17 git diff --exit-code # check no changes release: .goreleaser.yml tools/goreleaser diff --git a/build/Dockerfile b/build/Dockerfile index 759a6268..747e2944 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,5 +1,5 @@ # stage 1 building the code -FROM golang:1.16 as builder +FROM golang:1.17 as builder ARG VERSION ARG SHORT_COMMIT @@ -10,7 +10,7 @@ WORKDIR /golangci RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X main.commit=$SHORT_COMMIT -X main.date=$DATE" -o golangci-lint ./cmd/golangci-lint/main.go # stage 2 -FROM golang:1.16 +FROM golang:1.17 # don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume COPY --from=builder /golangci/golangci-lint /usr/bin/ CMD ["golangci-lint"] diff --git a/build/Dockerfile.alpine b/build/Dockerfile.alpine index 5ff7a14c..7aeba1b7 100644 --- a/build/Dockerfile.alpine +++ b/build/Dockerfile.alpine @@ -1,5 +1,5 @@ # stage 1 building the code -FROM golang:1.16-alpine as builder +FROM golang:1.17-alpine as builder ARG VERSION ARG SHORT_COMMIT @@ -15,7 +15,7 @@ RUN apk --no-cache add gcc musl-dev git mercurial RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X main.commit=$SHORT_COMMIT -X main.date=$DATE" -o golangci-lint ./cmd/golangci-lint/main.go # stage 2 -FROM golang:1.16-alpine +FROM golang:1.17-alpine # gcc is required to support cgo; # git and mercurial are needed most times for go get`, etc. # See https://github.com/docker-library/golang/issues/80