Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use distroless/static image instead of distroless/base since glibc is not used #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS build
WORKDIR /fn

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

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

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