Skip to content

Commit

Permalink
remove previous user before creating new one (#219)
Browse files Browse the repository at this point in the history
avoids issues with default home dir being owned by root
  • Loading branch information
minrk authored Oct 15, 2024
1 parent 0a79e58 commit 085c24f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ FROM ghcr.io/jorgensd/dolfinx-tutorial:release
# create user with a home directory
ARG NB_USER=jovyan
ARG NB_UID=1000
# 24.04 adds uid 1000, skip this if uid already exists
RUN useradd -m ${NB_USER} -u ${NB_UID} || true
# 24.04 adds `ubuntu` as uid 1000;
# remove it if it already exists before creating our user
RUN id -nu ${NB_UID} && userdel --force $(id -nu ${NB_UID}) || true; \
useradd -m ${NB_USER} -u ${NB_UID}
ENV HOME=/home/${NB_USER}

# Copy home directory for usage in binder
Expand Down

0 comments on commit 085c24f

Please sign in to comment.