From 2152d02e236ea2e4b0ef8a2019a71d78bb87e9dc Mon Sep 17 00:00:00 2001 From: jo-fra <69941576+jo-fra@users.noreply.github.com> Date: Fri, 13 Feb 2026 11:28:24 +0000 Subject: [PATCH] Fix entrypoint group ordering for ubuntu user Signed-off-by: jo-fra <69941576+jo-fra@users.noreply.github.com> --- docker/setup/entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/setup/entrypoint.sh b/docker/setup/entrypoint.sh index efd9eb1f0..5b17b3d7c 100755 --- a/docker/setup/entrypoint.sh +++ b/docker/setup/entrypoint.sh @@ -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" \