Add GOPROXY for go module operations

Without a GOPROXY, go modules are fetched from their respective hosts,
which increases the likelihood that any given host might be unavailable
and break builds.

Fixes #2036

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
Nolan Brubaker
2019-11-04 13:40:16 -05:00
parent 984e2ce589
commit c5d0110429

View File

@@ -19,6 +19,8 @@ WORKDIR /go/src/k8s.io
RUN git config --global advice.detachedHead false
RUN git clone -b kubernetes-1.15.3 https://github.com/kubernetes/code-generator
RUN git clone -b kubernetes-1.15.3 https://github.com/kubernetes/apimachinery
# Use a proxy for go modules to reduce the likelihood of various hosts being down and breaking the build
ENV GOPROXY=https://proxy.golang.org
# vendor code-generator go modules to be compatible with pre-1.15
WORKDIR /go/src/k8s.io/code-generator
# Don't use ENV here because we don't want to disable modules for subsequent commands