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

RHOAIENG-72: Specify numeric UID in Dockerfiles #348

Merged
Merged
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
2 changes: 1 addition & 1 deletion components/notebook-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ COPY --from=builder /workspace/notebook-controller/bin/manager /manager
COPY --from=builder /workspace/notebook-controller/third_party/license.txt third_party/license.txt

## Switch to a non-root user
USER rhods
USER 1001:0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to include also GID here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenShift default is to set random uid and 0 gid, https://access.redhat.com/documentation/cn/openshift_container_platform/4.15/html/images/creating-images#use-uid_create-images

I feel like we should keep close to that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I read this link before, since you have it in the description... so I probably missed something here.
My point is - why setting also GID here as it is 0 by default anyway. From your answer, I understand that it's just a precaution, correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.


ENTRYPOINT [ "/manager" ]
2 changes: 1 addition & 1 deletion components/odh-notebook-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ COPY --from=builder /workspace/odh-notebook-controller/bin/manager /manager
COPY --from=builder /workspace/odh-notebook-controller/third_party/license.txt third_party/license.txt

## Switch to a non-root user
USER rhods
USER 1001:0

ENTRYPOINT [ "/manager" ]