From b9a63e5e6682b75fc3564bf6123f198009b1dc1a Mon Sep 17 00:00:00 2001 From: Jacob Urbanczyk Date: Mon, 22 Jan 2024 20:03:27 +0100 Subject: [PATCH] fix: running the container with PUID=0 and PGID=0 --- docker/entry.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/entry.sh b/docker/entry.sh index 2754ddecfe..5bc077afc4 100644 --- a/docker/entry.sh +++ b/docker/entry.sh @@ -12,18 +12,18 @@ add_user() { } change_user() { - # If container is started as root then create a new user and switch to it - if [ "$(id -u)" = "0" ]; then + if [ "$(id -u)" = $PUID ]; then + echo " + User uid: $PUID + User gid: $PGID + " + elif [ "$(id -u)" = "0" ]; then + # If container is started as root then create a new user and switch to it add_user chown -R $PUID:$PGID /app echo "Switching to dedicated user" exec gosu $PUID "$BASH_SOURCE" "$@" - elif [ "$(id -u)" = $PUID ]; then - echo " - User uid: $PUID - User gid: $PGID - " fi }