We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c3995e commit 5dcf7ffCopy full SHA for 5dcf7ff
test/gnmi/Dockerfile
@@ -26,11 +26,18 @@ RUN --mount=type=bind,target=. \
26
27
FROM alpine:${ALPINE_VERSION}
28
29
+# Create a non-root user
30
+RUN addgroup -g 65532 -S nonroot && \
31
+ adduser -u 65532 -S nonroot -G nonroot
32
+
33
# Switch into workspace
34
WORKDIR /
35
-# Copy executable from build
-COPY --from=build /usr/bin/server /
36
+# Copy executable from build and set ownership to non-root user
37
+COPY --from=build --chown=nonroot:nonroot /usr/bin/server /server
38
39
+# Switch to non-root user
40
+USER nonroot
41
42
# Start the server application
43
CMD ["/server", "--port=9339", "--http-port=8000"]
0 commit comments