From ab4a6208b71a9d2c6b25392a1eeb966875b75505 Mon Sep 17 00:00:00 2001 From: Phoeniix Zhao Date: Sun, 26 Nov 2023 16:57:22 +0800 Subject: [PATCH] chore: modify image url and add go proxy in Dockerfile Signed-off-by: Phoeniix Zhao --- Dockerfile | 7 ++++--- config/default/manager_auth_proxy_patch.yaml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3618adcc..06f11d1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,12 @@ COPY go.mod go.mod COPY go.sum go.sum # cache deps before building and copying source so that we don't need to re-download as much # and so that source changes don't invalidate our downloaded layer -RUN go mod download +RUN export GOPROXY=https://goproxy.io/ && go mod download # Copy the go source COPY cmd/main.go cmd/main.go COPY api/ api/ -COPY internal/controller/ internal/controller/ +COPY internal/ internal/ # Build # the GOARCH does not have a default value to allow the binary be built according to the host where the command @@ -25,7 +25,8 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o ma # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot +# FROM gcr.io/distroless/static:nonroot +FROM kubeimages/distroless-static:latest WORKDIR / COPY --from=builder /workspace/manager . USER 65532:65532 diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 70c3437f..be58724e 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -15,7 +15,7 @@ spec: capabilities: drop: - "ALL" - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0 + image: quay.io/brancz/kube-rbac-proxy:v0.15.0 args: - "--secure-listen-address=0.0.0.0:8443" - "--upstream=http://127.0.0.1:8080/"