Non-root user should be specified in numeric form in Dockerfile

This commit is contained in:
Waleed Malik
2021-07-29 15:24:09 +05:00
parent 6397a35e32
commit 96a44153de
+2 -2
View File
@@ -1,5 +1,5 @@
# Build the manager binary # Build the manager binary
FROM --platform=${BUILDPLATFORM} golang:1.15.2 as builder FROM --platform=${BUILDPLATFORM} golang:1.16 as builder
ARG TARGETOS ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
@@ -26,7 +26,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build
FROM gcr.io/distroless/static:nonroot FROM gcr.io/distroless/static:nonroot
WORKDIR / WORKDIR /
COPY --from=builder /workspace/manager . COPY --from=builder /workspace/manager .
USER nonroot:nonroot USER 65532:65532
# Port for metrics and probes # Port for metrics and probes
EXPOSE 9090 EXPOSE 9090