Skip to content

Conversation

@ApdowJN
Copy link

@ApdowJN ApdowJN commented Nov 21, 2025

Fix for User/Group Creation Bug

The script sometimes failed when attempting to re-create the host user (e.g., ubuntu with UID 1000) inside the container.

Problem: The userdel "$DOCKER_RUN_USER_NAME" command, intended for cleanup, occasionally deleted the corresponding primary group ($DOCKER_RUN_GROUP_NAME) if the user was its sole member. This caused the subsequent useradd command to fail with useradd: group 'ubuntu' does not exist.

Fix: A necessary, idempotent groupadd --force call is re-inserted immediately after the userdel operation. This ensures the target group is immediately restored and confirmed to exist just before the final useradd attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant