From c8a90e73f6ae0b57c01a5b406d6a75a89c8363f6 Mon Sep 17 00:00:00 2001 From: Krishna Raman Date: Wed, 23 Feb 2022 09:02:10 -0800 Subject: [PATCH] Change container image USER to UID (#738) * Change container image USER to UID Kubernetes requires USER to be UID in order to verify running as non root. ref https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kuberuntime/security_context_others.go#L49 * Use 65532 as nonroot UID --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ddfa75f241..d44964bc40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags="-X $ FROM gcr.io/distroless/static:nonroot WORKDIR / COPY --from=builder /workspace/manager . -USER nonroot:nonroot +USER 65532:65532 ENTRYPOINT ["/manager"]