From a0b8284b762346245e6b61f78de188744c2217d7 Mon Sep 17 00:00:00 2001 From: Jannik Hollenbach Date: Fri, 12 Apr 2024 16:46:27 +0200 Subject: [PATCH] Remove duplicated user declaration / configuration The image is already running as nonroot, specified via the image tag (`gcr.io/distroless/static:nonroot`) Specifing it here again using the username makes deploying it to kubernetes slightly more annoying as this failed the `runAsNonRoot` securityContext check as kubernetes can't verify that this is actually non-root as it's not configured via the uid. Signed-off-by: Jannik Hollenbach --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2b47f3..1b74034 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,5 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o telemetr FROM gcr.io/distroless/static:nonroot WORKDIR / COPY --from=builder /workspace/telemetry . -USER nonroot:nonroot ENV GIN_MODE release ENTRYPOINT ["/telemetry"] \ No newline at end of file