Skip to content

Commit

Permalink
init-docker-image: remove ubuntu user if it exists
Browse files Browse the repository at this point in the history
Noble has a predefined ubuntu user with 1000 uid. This prevents the
creation of another user with 1000 uid so we need to delete it if
it exists.
  • Loading branch information
Adam Seres authored and adamseres committed Oct 24, 2024
1 parent 6fc8700 commit b87396f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bldr/data/files/usr/local/bin/init-docker-image
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
set -e
echo "Preparing BLDR deb builder docker image"

if getent passwd ubuntu; then
echo "Deleting ubuntu user"
userdel -r ubuntu
fi

echo "Adding non-privileged user ${NONPRIV_USER_NAME} with uid ${NONPRIV_USER_UID}"
useradd -u ${NONPRIV_USER_UID} ${NONPRIV_USER_NAME} -m

Expand Down

0 comments on commit b87396f

Please sign in to comment.