From 358b1623a0e2ca58435ebd9ed524f2c6ebdc6704 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 19 Jan 2023 10:20:03 -0800 Subject: [PATCH] Fix installation and upgrade kustomize version to 4.5.7 for gitlab-operator-base These changes were necessary for Go 1.18 to build. --- Dockerfile.gitlab-operator-build-base | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Dockerfile.gitlab-operator-build-base b/Dockerfile.gitlab-operator-build-base index 3fcff50..d51a100 100644 --- a/Dockerfile.gitlab-operator-build-base +++ b/Dockerfile.gitlab-operator-build-base @@ -23,13 +23,11 @@ RUN mkdir -p /src \ ## Kustomize FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as kustomize -ARG KUSTOMIZE_VERSION=3.8.10 +ARG KUSTOMIZE_VERSION=4.5.7 ENV GOPROXY="https://proxy.golang.org/" RUN apk add --no-cache gcc musl-dev -RUN mkdir /src && cd /src; \ - go mod init tmp && \ - go get sigs.k8s.io/kustomize/kustomize/v3@v${KUSTOMIZE_VERSION} +RUN go install sigs.k8s.io/kustomize/kustomize/v4@v${KUSTOMIZE_VERSION} ## Controller-gen FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as controller-gen @@ -37,9 +35,7 @@ FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as controller-gen ARG CONTROLLER_GEN_VERSION=0.7.0 ENV GOPROXY="https://proxy.golang.org/" -RUN mkdir /src && cd /src; \ - go mod init tmp \ - && go get sigs.k8s.io/controller-tools/cmd/controller-gen@v${CONTROLLER_GEN_VERSION} +RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v${CONTROLLER_GEN_VERSION} ## Build FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as build @@ -61,9 +57,9 @@ RUN apk add --no-cache podman buildah curl make gcc musl-dev git bash coreutils # accomodate running podman within docker RUN sed -i 's#^driver.*$#driver = "vfs"#g' /etc/containers/storage.conf -RUN go get -u \ - github.com/onsi/ginkgo/ginkgo \ - golang.org/x/lint/golint +ARG GINKGO_VERSION=1.16.5 +RUN go install github.com/onsi/ginkgo/ginkgo@v${GINKGO_VERSION} +RUN go install golang.org/x/lint/golint@latest # Kubebuilder RUN mkdir -p /usr/local/kubebuilder/bin \