Skip to content

Commit

Permalink
Entrypoint: Alpine fix overlapping PGID issue
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi311 committed Sep 13, 2024
1 parent b3b0cca commit 0c218fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ if [ "$(id -u)" = '0' ]; then
if command -v useradd > /dev/null; then
useradd --no-create-home -u "$PUID" -g "$PGID" jellyplex_watched
elif command -v adduser > /dev/null; then
# Get the group name based on the PGID since adduser does not have a flag to specify the group id
# and if the group id already exists the group name will be sommething unexpected
GROUPNAME=$(getent group "$PGID" | cut -d: -f1)

# Use alpine busybox adduser syntax
adduser -D -H -u "$PUID" -G jellyplex_watched jellyplex_watched
adduser -D -H -u "$PUID" -G "$GROUPNAME" jellyplex_watched
fi
fi
else
Expand Down

0 comments on commit 0c218fa

Please sign in to comment.