From 5ec69811c10cd66b16080c1dd40e4e1baf3b0790 Mon Sep 17 00:00:00 2001 From: Andrew Lytvynov Date: Fri, 23 Aug 2024 10:31:25 -0700 Subject: [PATCH] Dockerfile: switch base image to distroless Chainguard removed arm/v7 support from their free images: https://www.chainguard.dev/unchained/changes-to-static-git-and-busybox-developer-images Switch to the official `go` image for builds and distroless for packaging. Signed-off-by: Andrew Lytvynov --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a70d9e6..58d104a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/wolfi-base as build -RUN apk update && apk add build-base git openssh go-1.21 +FROM --platform=$BUILDPLATFORM golang:1.23-alpine as build WORKDIR /work @@ -14,8 +13,7 @@ RUN \ fi; \ GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -v ./cmd/golink - -FROM cgr.dev/chainguard/static:latest +FROM gcr.io/distroless/static-debian12:nonroot ENV HOME /home/nonroot