From f51ed22c969d79ed9dca92e8a314beb89b13ffc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Fri, 14 Jun 2024 14:56:33 +0200 Subject: [PATCH] RHOAIENG-72: Specify numeric UID in Dockerfiles 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 --- components/notebook-controller/Dockerfile | 2 +- components/odh-notebook-controller/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/notebook-controller/Dockerfile b/components/notebook-controller/Dockerfile index cac8594e54d..8b452930b78 100644 --- a/components/notebook-controller/Dockerfile +++ b/components/notebook-controller/Dockerfile @@ -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" ] diff --git a/components/odh-notebook-controller/Dockerfile b/components/odh-notebook-controller/Dockerfile index 996900f882f..dfc24f648bb 100644 --- a/components/odh-notebook-controller/Dockerfile +++ b/components/odh-notebook-controller/Dockerfile @@ -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" ]