Skip to content

Commit

Permalink
still trying to fix the " fatal: The GID `1000' is already in use" error
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoensing committed Aug 21, 2024
1 parent 9996647 commit a4795c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ if ! id "$DOCKER_USER" >/dev/null 2>&1; then
if getent group $GROUP_ID >/dev/null 2>&1; then
EXISTING_GROUP=$(getent group $GROUP_ID | cut -d: -f1)
echo "GID $GROUP_ID is already in use by group $EXISTING_GROUP. Using this group."
DOCKER_GROUP=$EXISTING_GROUP
else
addgroup --gid $GROUP_ID $DOCKER_GROUP
echo "Created group $DOCKER_GROUP with GID $GROUP_ID."
fi

# Create user with the specified UID and existing or new group
# Create user with the specified UID and associated group
adduser --shell /bin/sh --uid $USER_ID --ingroup $DOCKER_GROUP --disabled-password --gecos "" $DOCKER_USER

# Set ownership and permissions
Expand Down

0 comments on commit a4795c8

Please sign in to comment.