From 90d3d6cadae8133bf643f430676aa5bbf2a2a5af Mon Sep 17 00:00:00 2001 From: Brad Wadsworth Date: Fri, 27 Dec 2024 09:35:48 -0600 Subject: [PATCH] modified Dockerfile source images to use smaller base images --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e47090..12dc61c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # We use the latest Go 1.x version unless asked to use something else. # The GitHub Actions CI job sets this argument for a consistent Go version. ARG GO_VERSION=1 -ARG BASE_IMAGE=kcllang/kcl +ARG BASE_IMAGE=debian:bookworm-slim # Setup the base environment. The BUILDPLATFORM is set automatically by Docker. # The --platform=${BUILDPLATFORM} flag tells Docker to build the function using @@ -33,7 +33,7 @@ ARG TARGETARCH RUN --mount=target=. \ --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /function . + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags "-w -s" -o /function . # Produce the Function image. We use a very lightweight 'distroless' image that # does not include any of the build tools used in previous stages.