Non-root container
A non-root container runs its application process as a user other than root inside the container. In this course, the distroless nonroot image and USER nonroot:nonroot instruction limit the privileges available to the Go API and worker processes.
Minimal example
FROM gcr.io/distroless/static:nonroot
COPY --from=builder /out/api /api
USER nonroot:nonroot
ENTRYPOINT ["/api"]Learn this concept
Lesson 7.1 · Multi-stage Dockerfiles for GoUsed in exercises
Exercise 7.2 · Production container stackPrerequisite conceptsDistroless image