From 0c218fa9dd2f4bd3a328590c24c6da06ddf90e20 Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Fri, 13 Sep 2024 16:24:58 -0600 Subject: [PATCH] Entrypoint: Alpine fix overlapping PGID issue --- entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e1297b5..7e0bde0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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