Skip to content

Commit

Permalink
Use UID number rather than username in Dockerfile
Browse files Browse the repository at this point in the history
Systems configured to disallow running images as root aren't able to run images that use user name string values for the `USER` because they can't validate that a named user isn't root. To allow this image to run on such systems, use the uid of the user as the value for `USER` instead of the username.

See: kubernetes/kubernetes#56503
  • Loading branch information
candrews authored Jan 16, 2025
1 parent af14a2e commit da10b33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY --from=build /pack/markdownlint-cli2-*.tgz /
RUN npm install --global --no-package-lock --production /markdownlint-cli2-*.tgz
RUN rm /markdownlint-cli2-*.tgz

USER node
USER 1000

WORKDIR /workdir

Expand Down

0 comments on commit da10b33

Please sign in to comment.