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
FROM --platform=${BUILDPLATFORM} golang:1.15.2 as builder
FROM --platform=${BUILDPLATFORM} golang:1.16 as builder
ARG TARGETOS
ARG TARGETARCH
@@ -26,7 +26,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER nonroot:nonroot
USER 65532:65532
# Port for metrics and probes
EXPOSE 9090