Skip to content

Commit

Permalink
Switch to numeric USER lines to be supported by 'runAsNonRoot:true'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Smalling committed Sep 9, 2021
1 parent a27b696 commit 85bb97a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN build/build.sh
# STAGE 2: Runtime
FROM alpine

USER nobody:nobody
COPY --from=build /go/bin/kuard /kuard

CMD [ "/kuard" ]
4 changes: 3 additions & 1 deletion Dockerfile.kuard
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ FROM ARG_FROM

ADD bin/ARG_FAKEVER/ARG_ARCH/kuard /kuard

USER nobody:nobody
# Set non-root nobody:nobody user (using UID:GID to support k8s SecurityContext runAsNonRoot:true)
USER 65534:65534

CMD ["/kuard"]
4 changes: 3 additions & 1 deletion Dockerfile.nomultistage
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ ENV VERSION=test
# Do the build. Script is part of incoming sources.
RUN build/build.sh

# At runtime run as non-root user
# Set non-root nobody:nobody user (using UID:GID to support k8s SecurityContext runAsNonRoot:true)
USER 65534:65534

USER nobody:nobody

CMD [ "/go/bin/kuard" ]

0 comments on commit 85bb97a

Please sign in to comment.