mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
set GO111MODULE=on for build container
Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
FROM golang:1.13
|
||||
|
||||
ENV GO111MODULE=on
|
||||
# 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
|
||||
|
||||
@@ -22,17 +23,13 @@ RUN mkdir -p /go/src/k8s.io
|
||||
WORKDIR /go/src/k8s.io
|
||||
RUN git config --global advice.detachedHead false
|
||||
RUN git clone -b kubernetes-1.17.0 https://github.com/kubernetes/code-generator
|
||||
# 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
|
||||
RUN GO111MODULE=on go mod vendor
|
||||
|
||||
# get controller-tools
|
||||
RUN GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.4
|
||||
RUN go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.4
|
||||
|
||||
# get goimports (the revision is pinned so we don't indiscriminately update, but the particular commit
|
||||
# is not important)
|
||||
RUN GO111MODULE=on go get golang.org/x/tools/cmd/goimports@11e9d9cc0042e6bd10337d4d2c3e5d9295508e7d
|
||||
RUN go get golang.org/x/tools/cmd/goimports@11e9d9cc0042e6bd10337d4d2c3e5d9295508e7d
|
||||
|
||||
# get protoc compiler and golang plugin
|
||||
WORKDIR /root
|
||||
@@ -41,7 +38,7 @@ RUN wget --quiet https://github.com/protocolbuffers/protobuf/releases/download/v
|
||||
unzip protoc-3.9.1-linux-x86_64.zip && \
|
||||
mv bin/protoc /usr/bin/protoc && \
|
||||
chmod +x /usr/bin/protoc
|
||||
RUN GO111MODULE=on go get github.com/golang/protobuf/protoc-gen-go@v1.0.0
|
||||
RUN go get github.com/golang/protobuf/protoc-gen-go@v1.0.0
|
||||
|
||||
# get goreleaser
|
||||
RUN wget --quiet https://github.com/goreleaser/goreleaser/releases/download/v0.120.8/goreleaser_Linux_x86_64.tar.gz && \
|
||||
|
||||
Reference in New Issue
Block a user