Skip to content

Commit e450a1c

Browse files
authored
Merge pull request #3997 from AkihiroSuda/refactor-dockerfile-goversion
Dockerfile: remove "goversion" stage
2 parents 8eb594a + e33a85f commit e450a1c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,16 @@ VOLUME /var/lib/nerdctl
270270
ENTRYPOINT ["/docker-entrypoint.sh"]
271271
CMD ["bash", "--login", "-i"]
272272

273-
# convert GO_VERSION=1.16 to the latest release such as "go1.16.1"
274-
FROM golang:${GO_VERSION}-alpine AS goversion
275-
RUN go env GOVERSION > /GOVERSION
276-
277273
FROM base AS test-integration
278274
ARG DEBIAN_FRONTEND=noninteractive
279275
# `expect` package contains `unbuffer(1)`, which is used for emulating TTY for testing
280276
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
281277
expect \
282278
git \
283279
make
284-
COPY --from=goversion /GOVERSION /GOVERSION
280+
# We wouldn't need this if Docker Hub could have "golang:${GO_VERSION}-ubuntu"
281+
COPY --from=build-base-debian /usr/local/go /usr/local/go
285282
ARG TARGETARCH
286-
RUN curl -fsSL --proto '=https' --tlsv1.2 https://golang.org/dl/$(cat /GOVERSION).linux-${TARGETARCH:-amd64}.tar.gz | tar xzvC /usr/local
287283
ENV PATH=/usr/local/go/bin:$PATH
288284
ARG GOTESTSUM_VERSION
289285
RUN GOBIN=/usr/local/bin go install gotest.tools/gotestsum@${GOTESTSUM_VERSION}

0 commit comments

Comments
 (0)