Skip to content
RED SAGSkills
medium10 pts · first answer countsdockercontainer-security

Why use multi-stage builds

What is the main benefit of this multi-stage Dockerfile?

FROM golang:1.23 AS build
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 go build -o /out/app ./cmd/app

FROM gcr.io/distroless/static-debian12
COPY --from=build /out/app /app
USER nonroot
ENTRYPOINT ["/app"]
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions