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"]
Discussion 0
Join free to post in the discussion.
Related questions
- Ordering Dockerfile steps for cachingDevOps Engineer
- Image vs containerDevOps Engineer
- Why use a .dockerignore fileDevOps Engineer
- Container exits right after startDevOps Engineer
- Running containers as non-rootDevOps Engineer
- Container ignores SIGTERMDevOps Engineer
- Same tag, different imageDevOps Engineer
- Deleted secret still in the imageDevOps Engineer