From 96a44153deb4a542eec8a3e516e1f1803607f321 Mon Sep 17 00:00:00 2001 From: Waleed Malik Date: Thu, 29 Jul 2021 15:24:09 +0500 Subject: [PATCH] Non-root user should be specified in numeric form in Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 368c44ab..a95f3c1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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