aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-04-23 18:29:09 -0500
committerJP Dillingham <jp@dillingham.me>2026-04-23 18:29:09 -0500
commit2f20ac833dca19e87e7980ac83f94206685409d9 (patch)
tree1ebad506bc42f3bc20e6825bf9f03715031c06ba /Dockerfile
parent3d9bc65bf535a3c4dab440e91587495afba648e6 (diff)
parent7961741f740abd240754ff6e39cda6d69f727268 (diff)
downloadslskd-2f20ac833dca19e87e7980ac83f94206685409d9.tar.gz
Merge remote-tracking branch 'origin/master' into blacklist-regex
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile16
1 files changed, 11 insertions, 5 deletions
diff --git a/Dockerfile b/Dockerfile
index 6fbff9cc..94b3d4b5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -98,11 +98,10 @@ LABEL org.opencontainers.image.title=slskd \
WORKDIR /slskd
COPY --from=publish /slskd/dist/${TARGETPLATFORM} .
-# supports two modes:
-# 1. --user / user: (modern Docker) — container starts as non-root,
-# skips all usermod/chown, execs the app directly.
-# 2. PUID/PGID (legacy linuxserver style) — container starts as root,
-# mutates user, chowns /app if needed, drops privileges via gosu.
+# supports three modes:
+# 1. --user / user: (modern Docker) — container starts as non-root, skips all usermod/chown, execs the app directly.
+# 2. PUID/PGID (legacy linuxserver style) — container starts as root, mutates user, chowns /app if needed, drops privileges via gosu.
+# 3. neither --user nor at least one of PUID/PGID supplied - container and app run as root
COPY <<'SCRIPT' /entrypoint.sh
#!/bin/bash
set -e
@@ -129,6 +128,13 @@ if [ "$(id -u)" -ne 0 ]; then
exec "$@"
fi
+# no --user supplied, neither PUID nor PGID supplied, run as root (same behavior as < 0.25.0)
+#---------------------------------------------------------------------------------------
+if [ -z "${PUID}" ] && [ -z "${PGID}" ]; then
+ umask "$SLSKD_UMASK"
+ exec "$@"
+fi
+
# PUID/PGID mode; user has provided explicit user and group IDs to use
#---------------------------------------------------------------------------------------
PUID="${PUID:-1000}"