From b0bc9b6b2e6d97fa87d3632b73c8069e8be7ff1a Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:56:42 -0800 Subject: [PATCH] Tweak: skip chown operations when running as root (#6170) --- docker-entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 03b410f4d..51a52523c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -22,7 +22,9 @@ if [ "$HOSTNAME" = "::" ]; then fi # Check ownership before chown -if [ -e /app/config ]; then +if [ "$PUID" = "0" ]; then + echo "Skipping ownership changes for /app/config" +elif [ -e /app/config ]; then CURRENT_UID=$(stat -c %u /app/config) CURRENT_GID=$(stat -c %g /app/config) @@ -39,7 +41,9 @@ else fi # Ensure /app/config/logs exists and is owned -if [ -n "$PUID" ] && [ -n "$PGID" ]; then +if [ "$PUID" = "0" ]; then + echo "Skipping ownership changes for /app/config/logs" +elif [ -n "$PUID" ] && [ -n "$PGID" ]; then mkdir -p /app/config/logs 2>/dev/null || true if [ -d /app/config/logs ]; then LOG_UID=$(stat -c %u /app/config/logs)