Skip to content

Commit

Permalink
Use numeric uid in Dockerfile's USER to overcome issue with runAsNonRoot
Browse files Browse the repository at this point in the history
- "Error: container has runAsNonRoot and image has non-numeric user (pulsar),
 cannot verify user is non-root"
  • Loading branch information
lhotari committed Jan 20, 2022
1 parent 1b2b0e2 commit 01bc5d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/pulsar-all/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN mkdir /pulsar/connectors /pulsar/offloaders && \
chmod g=u /pulsar/connectors /pulsar/offloaders

# Return to pulsar (non root) user
USER pulsar
USER 10000

COPY --from=pulsar-all /connectors/pulsar-io-elastic-search-*.nar /pulsar/connectors/
COPY --from=pulsar-all /connectors/pulsar-io-kinesis-*.nar /pulsar/connectors/
Expand Down
2 changes: 1 addition & 1 deletion docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ WORKDIR /pulsar
RUN /pulsar/bin/install-pulsar-client.sh

# Switch to the pulsar user to ensure container defaults to run as a non root user
USER pulsar
USER 10000

0 comments on commit 01bc5d6

Please sign in to comment.