From 16b709133f001cb5591dbbefbee45d419174465a Mon Sep 17 00:00:00 2001 From: alanjino Date: Tue, 14 May 2024 13:14:56 +0530 Subject: [PATCH] update: Added chainguard image as base image --- dockerfiles/agent/container/Dockerfile | 2 +- dockerfiles/agent/git/Dockerfile | 2 +- dockerfiles/client/Dockerfile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dockerfiles/agent/container/Dockerfile b/dockerfiles/agent/container/Dockerfile index c8b31212..aa8c3955 100644 --- a/dockerfiles/agent/container/Dockerfile +++ b/dockerfiles/agent/container/Dockerfile @@ -6,7 +6,7 @@ COPY ./ ./ RUN go mod download RUN CGO_ENABLED=0 go build -o ./build/agent agent/container/main.go -FROM cgr.dev/chainguard/static:latest +FROM scratch COPY --from=builder ./build/agent agent USER 65532:65532 diff --git a/dockerfiles/agent/git/Dockerfile b/dockerfiles/agent/git/Dockerfile index 5b8656f1..b57e6586 100644 --- a/dockerfiles/agent/git/Dockerfile +++ b/dockerfiles/agent/git/Dockerfile @@ -6,7 +6,7 @@ COPY ./ ./ RUN go mod download RUN CGO_ENABLED=0 go build -o ./build/agent agent/git/main.go -FROM cgr.dev/chainguard/static:latest +FROM scratch COPY --from=builder ./build/agent agent USER 65532:65532 diff --git a/dockerfiles/client/Dockerfile b/dockerfiles/client/Dockerfile index a8e03478..6da67bae 100644 --- a/dockerfiles/client/Dockerfile +++ b/dockerfiles/client/Dockerfile @@ -1,6 +1,6 @@ # Build the manager binary FROM cgr.dev/chainguard/go:latest AS builder - +RUN apk update && apk add go-1.21 WORKDIR /workspace # Copy the Go Modules manifests COPY ./ ./ @@ -11,7 +11,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o k8smetri # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM cgr.dev/chainguard/static:latest +FROM scratch WORKDIR / COPY --from=builder /workspace/k8smetrics_client . USER 65532:65532