From 4d49e307e35aeb55c91373cef89adb58fd593a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Urba=C5=84czyk?= Date: Sat, 27 Jan 2024 17:48:38 +0000 Subject: [PATCH] fix: running the container with PUID=0 and PGID=0 (#3030) Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com> --- 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 }