From 303d2d0dc8e59858446ef1ae96cbac8063afe5cf Mon Sep 17 00:00:00 2001 From: Scott Trent Date: Tue, 2 Jul 2024 12:19:33 +0900 Subject: [PATCH] Use more recent packages in container Signed-off-by: Scott Trent --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce43f79..1c9b042 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,12 @@ ARG TARGETOS ARG TARGETARCH WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum +# Copy the Go Modules manifests (go.sum and go.mod) +COPY go.* . # 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 apk upgrade --no-cache && \ + go mod download # Copy the go source COPY cmd/main.go cmd/main.go @@ -25,8 +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:debug +FROM gcr.io/distroless/static-debian12:nonroot +# FROM gcr.io/distroless/static-debian12:debug WORKDIR / COPY --from=builder /workspace/manager . COPY cmd/debug-entrypoint.sh .