Skip to content

Commit

Permalink
RHOAIENG-72: Specify numeric UID in Dockerfiles
Browse files Browse the repository at this point in the history
This resolves the

```
Error: container has runAsNonRoot and image has non-numeric user (rhods), cannot verify user is non-root
```

issue.

OpenShift (by default)
runs images under a random user id and the root user group.

See https://access.redhat.com/documentation/cn/openshift_container_platform/4.15/html/images/creating-images#use-uid_create-images
  • Loading branch information
jiridanek committed Jun 14, 2024
1 parent 0c21e98 commit d469970
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

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" ]

0 comments on commit d469970

Please sign in to comment.