Skip to content

Commit 650caa1

Browse files
committed
images/go-runner/Dockerfile: Explicitly set 'direct' fallback in GOPROXY
From https://golang.org/doc/go1.15#go-command: The GOPROXY environment variable now supports skipping proxies that return errors. Proxy URLs may now be separated with either commas (,) or pipe characters (|). If a proxy URL is followed by a comma, the go command will only try the next proxy in the list after a 404 or 410 HTTP response. If a proxy URL is followed by a pipe character, the go command will try the next proxy in the list after any error. Note that the default value of GOPROXY remains https://proxy.golang.org,direct, which does not fall back to direct in case of errors. Signed-off-by: Stephen Augustus <[email protected]>
1 parent c41a690 commit 650caa1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

images/build/go-runner/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ ARG DISTROLESS_IMAGE
1818
FROM golang:${GO_VERSION} as builder
1919
WORKDIR /workspace
2020

21-
# Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy
22-
ARG goproxy=https://proxy.golang.org
23-
# Run this with docker build --build_arg package=./controlplane/kubeadm or --build_arg package=./bootstrap/kubeadm
24-
ENV GOPROXY=$goproxy
25-
2621
# Copy the sources
2722
COPY ./go-runner.go ./
2823
COPY ./go.* ./
2924

25+
ENV GOPROXY="https://proxy.golang.org|direct"
26+
3027
# Cache the go build
3128
RUN go build .
3229

0 commit comments

Comments
 (0)