Skip to content

Commit 72500ce

Browse files
change base image to distroless/static
Signed-off-by: Vilmos Martinek <[email protected]>
1 parent b6b56a6 commit 72500ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS build
1313
WORKDIR /fn
1414

1515
# Most functions don't want or need CGo support, so we disable it.
16+
# If CGo support is needed make sure to also change the base image to one that
17+
# includes glibc, like 'distroless/base'.
1618
ENV CGO_ENABLED=0
1719

1820
# We run go mod download in a separate step so that we can cache its results.
@@ -38,7 +40,7 @@ RUN --mount=target=. \
3840

3941
# Produce the Function image. We use a very lightweight 'distroless' image that
4042
# does not include any of the build tools used in previous stages.
41-
FROM gcr.io/distroless/base-debian11 AS image
43+
FROM gcr.io/distroless/static-debian12:nonroot AS image
4244
WORKDIR /
4345
COPY --from=build /function /function
4446
EXPOSE 9443

0 commit comments

Comments
 (0)