Skip to content

Commit 981e455

Browse files
committed
feat: remove default 'ubuntu' user on Ubuntu 23.04+
Starting from Ubuntu 23.04, the system includes a default 'ubuntu' user (UID 1000) to serve as a non-root OCI user. This cause errors when building the base image: `useradd: UID 1000 is not unique`. Since we don't need the default 'ubuntu' user, this commit removes it. Original PR: <kubeflow/kubeflow#7728> Signed-off-by: Junlin Zhou <[email protected]>
1 parent 290935a commit 981e455

File tree

1 file changed

+4
-1
lines changed
  • components/example-notebook-servers/base

1 file changed

+4
-1
lines changed

components/example-notebook-servers/base/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ RUN curl -fsSL "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETA
102102
&& chmod +x /usr/local/bin/kubectl
103103

104104
# create user and set required ownership
105-
RUN useradd -M -N \
105+
# Starting with Ubuntu 23.04, the system includes a default user named 'ubuntu' with UID 1000,
106+
# which conflicts with our default NB_UID. As this user is not needed, it is removed.
107+
RUN userdel -r ubuntu || true \
108+
&& useradd -M -N \
106109
--shell /bin/bash \
107110
--home ${HOME} \
108111
--uid ${NB_UID} \

0 commit comments

Comments
 (0)