Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to numeric USER lines to be supported by 'runAsNonRoot:true' (fixes issue #43) #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ RUN build/build.sh
# STAGE 2: Runtime
FROM alpine

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

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: 2 additions & 2 deletions Dockerfile.nomultistage
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV VERSION=test
# Do the build. Script is part of incoming sources.
RUN build/build.sh

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

CMD [ "/go/bin/kuard" ]