Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docker/setup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ set -euo pipefail
# at the end of the dockerfile
ldconfig

# Add the group of the user. User/group ID of the host user are set through env variables when calling docker run further down.
# Remove any existing user with the same name (userdel may also remove its primary group)
userdel "$DOCKER_RUN_USER_NAME" 2>/dev/null || true
userdel ubuntu 2>/dev/null || true

# Add the group of the user AFTER userdel, since userdel may have removed the primary group.
# User/group ID of the host user are set through env variables when calling docker run further down.
groupadd --force --gid "$DOCKER_RUN_GROUP_ID" "$DOCKER_RUN_GROUP_NAME"

# Re-add the user
userdel "$DOCKER_RUN_USER_NAME" 2>/dev/null || true
userdel ubuntu || true
useradd --no-log-init \
--uid "$DOCKER_RUN_USER_ID" \
--gid "$DOCKER_RUN_GROUP_NAME" \
Expand Down