From aa97bbee5e7708c0632f08cfac7f52a7908bb6e2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 7 Apr 2026 10:13:10 -0500 Subject: update docker images --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 5b174a0a..499b0135 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # build static web content # note: pin this to amd64 to speed it up, it is prohibitively slow under QEMU -FROM --platform=$BUILDPLATFORM node:18-alpine3.18 AS web +FROM --platform=$BUILDPLATFORM node:22-alpine AS web ARG VERSION=0.0.1.65534-local WORKDIR /slskd @@ -13,7 +13,7 @@ RUN sh ./bin/build --web-only --version $VERSION # build, test, and publish application binaries # note: this needs to be pinned to an amd64 image in order to publish armv7 binaries # https://github.com/dotnet/dotnet-docker/issues/1537#issuecomment-615269150 -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS publish +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-noble AS publish ARG TARGETPLATFORM ARG VERSION=0.0.1.65534-local @@ -32,7 +32,7 @@ RUN bash ./bin/build --dotnet-only --version $VERSION RUN bash ./bin/publish --no-prebuild --platform $TARGETPLATFORM --version $VERSION --output ../../dist/${TARGETPLATFORM} # application -FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-bookworm-slim AS slskd +FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-noble AS slskd ARG TARGETPLATFORM ARG TAG=0.0.1 ARG VERSION=0.0.1.65534-local -- cgit v1.2.3 From c1f86cd40005e6234d1f459439453023b8589dec Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 9 Apr 2026 19:03:37 -0500 Subject: wip --- Dockerfile | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 91 insertions(+), 8 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 499b0135..eef6ac52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# syntax=docker/dockerfile:1 +# ^ enable heredoc for BuildKit + # build static web content # note: pin this to amd64 to speed it up, it is prohibitively slow under QEMU FROM --platform=$BUILDPLATFORM node:22-alpine AS web @@ -43,6 +46,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ jq \ wget \ tini \ + gosu \ && \ rm -rf \ /tmp/* \ @@ -50,10 +54,13 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ /var/cache/apt/* \ /var/tmp/* -RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ - && chmod -R 777 /app \ +RUN groupadd -g 1000 slskd && \ + useradd -u 1000 -g slskd -d /app -s /sbin/nologin slskd + +RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ + && chown -R slskd:slskd /app \ && mkdir -p /.net \ - && chmod 777 /.net' + && chown slskd:slskd /.net' VOLUME /app @@ -64,7 +71,7 @@ ENV SHELL=/usr/bin/bash \ DOTNET_BUNDLE_EXTRACT_BASE_DIR=/.net \ DOTNET_gcServer=0 \ DOTNET_gcConcurrent=1 \ - DOTNET_GCHeapHardLimit=0x80000000 \ + DOTNET_GCHeapHardLimit=0x80000000 \ DOTNET_GCConserveMemory=9 \ SLSKD_UMASK=0022 \ SLSKD_HTTP_PORT=5030 \ @@ -91,7 +98,83 @@ LABEL org.opencontainers.image.title=slskd \ WORKDIR /slskd COPY --from=publish /slskd/dist/${TARGETPLATFORM} . -RUN echo "umask \$SLSKD_UMASK && ./slskd" > start.sh \ - && chmod +x start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "./start.sh"] +# supports two modes: +# 1. PUID/PGID (legacy linuxserver style) — container starts as root, +# mutates user, chowns /app if needed, drops privileges via gosu. +# 2. --user / user: (modern Docker) — container starts as non-root, +# skips all usermod/chown, execs the app directly. +COPY <<'ENTRYPOINT' /usr/local/bin/docker-entrypoint.sh +#!/bin/bash +set -e + +SLSKD_USER="slskd" +SLSKD_GROUP="slskd" +DEFAULT_PUID=1000 +DEFAULT_PGID=1000 + +# --user mode +if [ "$(id -u)" -ne 0 ]; then + umask "$SLSKD_UMASK" + exec "$@" +fi + +# PUID/PGID mode + +PUID="${PUID:-$DEFAULT_PUID}" +PGID="${PGID:-$DEFAULT_PGID}" + +echo " +─────────────────────────────────────── + slskd +─────────────────────────────────────── + PUID: ${PUID} + PGID: ${PGID} + UMASK: ${SLSKD_UMASK} +───────────────────────────────────────" + +if [ "${PUID}" = "0" ] || [ "${PGID}" = "0" ]; then + echo "[warn] Running as root (PUID=0 or PGID=0) is not recommended." +fi + +# Mutate group +current_gid=$(id -g "${SLSKD_USER}" 2>/dev/null || echo "") +if [ "${current_gid}" != "${PGID}" ]; then + groupmod -o -g "${PGID}" "${SLSKD_GROUP}" +fi + +# Mutate user — park homedir at /tmp first to prevent usermod from doing an +# implicit recursive chown of the home directory (linuxserver technique) +current_uid=$(id -u "${SLSKD_USER}" 2>/dev/null || echo "") +if [ "${current_uid}" != "${PUID}" ]; then + orig_home=$(getent passwd "${SLSKD_USER}" | cut -d: -f6) + usermod -d /tmp "${SLSKD_USER}" + usermod -o -u "${PUID}" "${SLSKD_USER}" + usermod -d "${orig_home}" "${SLSKD_USER}" +fi + +# Fix /app ownership, but only when PUID/PGID changed (binhex marker pattern). +# /app has only config, logs, and databases — always a small number of files. +# Shared volumes (/music, /downloads elsewhere, etc.) are never touched; the +# process runs as PUID:PGID so new files get correct ownership automatically. +prev_puid=$(cat /app/.slskd_puid 2>/dev/null || true) +prev_pgid=$(cat /app/.slskd_pgid 2>/dev/null || true) + +if [ "${prev_puid}" != "${PUID}" ] || [ "${prev_pgid}" != "${PGID}" ]; then + echo "[entrypoint] Applying ownership to /app (PUID:PGID = ${PUID}:${PGID})..." + chown -R "${PUID}:${PGID}" /app + echo "${PUID}" > /app/.slskd_puid + echo "${PGID}" > /app/.slskd_pgid + chown "${PUID}:${PGID}" /app/.slskd_puid /app/.slskd_pgid +fi + +# Ensure /.net is accessible (dotnet runtime extraction cache) +chown "${PUID}:${PGID}" /.net 2>/dev/null || true + +# Drop privileges and exec +umask "$SLSKD_UMASK" +exec gosu "${PUID}:${PGID}" "$@" +ENTRYPOINT +RUN chmod +x /usr/local/bin/docker-entrypoint.sh + +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"] +CMD ["./slskd"] \ No newline at end of file -- cgit v1.2.3 From 62fc77f48c34b27b41556062b9951a4fedf71301 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 9 Apr 2026 22:44:39 -0500 Subject: add directive to enable heredoc --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 499b0135..d4ca4bb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# syntax=docker/dockerfile:1 +# ^ enable heredoc for BuildKit + # build static web content # note: pin this to amd64 to speed it up, it is prohibitively slow under QEMU FROM --platform=$BUILDPLATFORM node:22-alpine AS web -- cgit v1.2.3 From 06b9b9d27ad378a59229bb31b4b94f2fc75c66db Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 9 Apr 2026 22:44:52 -0500 Subject: install gosu --- Dockerfile | 1 + 1 file changed, 1 insertion(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index d4ca4bb6..0beebcb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ jq \ wget \ tini \ + gosu \ && \ rm -rf \ /tmp/* \ -- cgit v1.2.3 From b7d23af65b7c67128a17c72025a996050b70751f Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 9 Apr 2026 22:45:14 -0500 Subject: add slskd user/group --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 0beebcb0..c28e15d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,10 +54,16 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ /var/cache/apt/* \ /var/tmp/* -RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ - && chmod -R 777 /app \ +# remove the default 'ubuntu' user that occupies 1000:1000 +# and replace it with our own slskd user/group +RUN userdel -r ubuntu && \ + groupadd -g 1000 slskd && \ + useradd -u 1000 -g slskd -d /app -s /sbin/nologin slskd + +RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ + && chown -R slskd:slskd /app \ && mkdir -p /.net \ - && chmod 777 /.net' + && chown slskd:slskd /.net' VOLUME /app -- cgit v1.2.3 From a278bdb398a4a54057c3454b292ff887e298c049 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 9 Apr 2026 22:45:34 -0500 Subject: add script --- Dockerfile | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 5 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index c28e15d2..1f1cc149 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,7 @@ ENV SHELL=/usr/bin/bash \ DOTNET_BUNDLE_EXTRACT_BASE_DIR=/.net \ DOTNET_gcServer=0 \ DOTNET_gcConcurrent=1 \ - DOTNET_GCHeapHardLimit=0x80000000 \ + DOTNET_GCHeapHardLimit=0x80000000 \ DOTNET_GCConserveMemory=9 \ SLSKD_UMASK=0022 \ SLSKD_HTTP_PORT=5030 \ @@ -101,7 +101,82 @@ LABEL org.opencontainers.image.title=slskd \ WORKDIR /slskd COPY --from=publish /slskd/dist/${TARGETPLATFORM} . -RUN echo "umask \$SLSKD_UMASK && ./slskd" > start.sh \ - && chmod +x start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "./start.sh"] +# supports two modes: +# 1. PUID/PGID (legacy linuxserver style) — container starts as root, +# mutates user, chowns /app if needed, drops privileges via gosu. +# 2. --user / user: (modern Docker) — container starts as non-root, +# skips all usermod/chown, execs the app directly. +COPY <<'SCRIPT' /entrypoint.sh + +#!/bin/bash +set -e + +# --user mode; user has provided a user via the command line or docker compose file +#--------------------------------------------------------------------------------------- +if [ "$(id -u)" -ne 0 ]; then + # if the user has also supplied PUID or PGID, let them know they need to use one or the other + if [ -n "${PUID}" ] || [ -n "${PGID}" ]; then + echo "ERROR: PUID/PGID are set but the container is running as a non-root user (using --user or user:)." + echo "Use one or the other, not both. Remove --user and set PUID/PGID, or remove PUID/PGID and use --user." + exit 1 + fi + + # exit if /app is not writable + if [ ! -r /app ] || [ ! -w /app ]; then + echo "ERROR: /app is not readable and/or writable by the current user ($(id -u):$(id -g))." + echo "When using --user, ensure the mounted directory is readable and writable by UID $(id -u)." + exit 1 + fi + + # set umask and launch + umask "$SLSKD_UMASK" + exec "$@" +fi + +# PUID/PGID mode; user has provided explicit user and group IDs to use +#--------------------------------------------------------------------------------------- +PUID="${PUID:-1000}" +PGID="${PGID:-1000}" + +if ! [[ "${PUID}" =~ ^[0-9]+$ ]]; then + echo "ERROR: PUID must be a non-negative integer, got '${PUID}'." + exit 1 +fi + +if ! [[ "${PGID}" =~ ^[0-9]+$ ]]; then + echo "ERROR: PGID must be a non-negative integer, got '${PGID}'." + exit 1 +fi + +# update group +current_gid=$(getent group slskd | cut -d: -f3) +echo "[entrypoint] current GID: ${current_gid}" +if [ "${current_gid}" != "${PGID}" ]; then + groupmod -o -g "${PGID}" slskd + usermod -g "${PGID}" slskd + echo "[entrypoint] new GID: ${PGID}" +fi + +# update user +current_uid=$(id -u slskd 2>/dev/null || echo "") +echo "[entrypoint] current UID: ${current_uid}" +if [ "${current_uid}" != "${PUID}" ]; then + usermod -o -u "${PUID}" slskd + echo "[entrypoint] new UID: ${PUID}" +fi + +# change owner of the directories we need to write +chown -R "${PUID}:${PGID}" /app +chown "${PUID}:${PGID}" /.net + +# set umask and launch +umask "$SLSKD_UMASK" +exec gosu "${PUID}:${PGID}" "$@" + +SCRIPT +# EOF + +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"] +CMD ["./slskd"] \ No newline at end of file -- cgit v1.2.3 From 4416629873ef5d01ec56e5c41794221041907f53 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Apr 2026 11:56:59 -0500 Subject: remove logs --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 93a7eb5e..47718043 100644 --- a/Dockerfile +++ b/Dockerfile @@ -149,19 +149,15 @@ fi # update group current_gid=$(getent group slskd | cut -d: -f3) -echo "[entrypoint] current GID: ${current_gid}" if [ "${current_gid}" != "${PGID}" ]; then groupmod -o -g "${PGID}" slskd usermod -g "${PGID}" slskd - echo "[entrypoint] new GID: ${PGID}" fi # update user current_uid=$(id -u slskd 2>/dev/null || echo "") -echo "[entrypoint] current UID: ${current_uid}" if [ "${current_uid}" != "${PUID}" ]; then usermod -o -u "${PUID}" slskd - echo "[entrypoint] new UID: ${PUID}" fi # change owner of the directories we need to write -- cgit v1.2.3 From 414271baf4f67aad21c2e12155f7675de0e60373 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Apr 2026 11:57:19 -0500 Subject: remove chown of .net --- Dockerfile | 1 - 1 file changed, 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 47718043..d9fa4245 100644 --- a/Dockerfile +++ b/Dockerfile @@ -162,7 +162,6 @@ fi # change owner of the directories we need to write chown -R "${PUID}:${PGID}" /app -chown "${PUID}:${PGID}" /.net # set umask and launch umask "$SLSKD_UMASK" -- cgit v1.2.3 From 31400b1ea7dda478ad5f03fc6eea67ad50e0214a Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Apr 2026 11:57:31 -0500 Subject: tweak docs --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index d9fa4245..351df9b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,10 +102,10 @@ WORKDIR /slskd COPY --from=publish /slskd/dist/${TARGETPLATFORM} . # supports two modes: -# 1. PUID/PGID (legacy linuxserver style) — container starts as root, -# mutates user, chowns /app if needed, drops privileges via gosu. -# 2. --user / user: (modern Docker) — container starts as non-root, +# 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. COPY <<'SCRIPT' /entrypoint.sh #!/bin/bash set -e -- cgit v1.2.3 From 1010244984ec3f3764add2b6bc07297f9b0ea5d1 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Apr 2026 11:57:43 -0500 Subject: typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 351df9b0..30036221 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,7 +83,7 @@ ENV SHELL=/usr/bin/bash \ SLSKD_APP_DIR=/app \ SLSKD_DOCKER_TAG=$TAG \ SLSKD_DOCKER_VERSION=$VERSION \ - SLSKD_DOCKER_REVISON=$REVISION \ + SLSKD_DOCKER_REVISION=$REVISION \ SLSKD_DOCKER_BUILD_DATE=$BUILD_DATE LABEL org.opencontainers.image.title=slskd \ -- cgit v1.2.3 From 263e54f0fa65179a035d438fce49e6f7d9d74bda Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Apr 2026 11:58:20 -0500 Subject: try extracting the .NET bundle during the build and then making the .net directory read-only --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 30036221..720b8c65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,9 +61,7 @@ RUN userdel -r ubuntu && \ useradd -u 1000 -g slskd -d /app -s /sbin/nologin slskd RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ - && chown -R slskd:slskd /app \ - && mkdir -p /.net \ - && chown slskd:slskd /.net' + && chown -R slskd:slskd /app' VOLUME /app @@ -101,6 +99,8 @@ LABEL org.opencontainers.image.title=slskd \ WORKDIR /slskd COPY --from=publish /slskd/dist/${TARGETPLATFORM} . +RUN ./slskd --version && chmod -R a-w /.net + # supports two modes: # 1. --user / user: (modern Docker) — container starts as non-root, # skips all usermod/chown, execs the app directly. -- cgit v1.2.3 From cda4ba06dd49388b61d8d7cd5fcb9158fbd4c88b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Apr 2026 12:08:10 -0500 Subject: revert pre-extraction and lockdown of .net --- Dockerfile | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 720b8c65..c1675229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,14 +54,13 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ /var/cache/apt/* \ /var/tmp/* -# remove the default 'ubuntu' user that occupies 1000:1000 -# and replace it with our own slskd user/group -RUN userdel -r ubuntu && \ - groupadd -g 1000 slskd && \ - useradd -u 1000 -g slskd -d /app -s /sbin/nologin slskd +RUN groupadd -o -g 1000 slskd && \ + useradd -o -u 1000 -g slskd slskd -RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ - && chown -R slskd:slskd /app' +RUN bash -c 'mkdir -p /app \ + && chown -R slskd:slskd /app \ + && mkdir -p /.net \ + && chmod 777 /.net' VOLUME /app @@ -99,8 +98,6 @@ LABEL org.opencontainers.image.title=slskd \ WORKDIR /slskd COPY --from=publish /slskd/dist/${TARGETPLATFORM} . -RUN ./slskd --version && chmod -R a-w /.net - # supports two modes: # 1. --user / user: (modern Docker) — container starts as non-root, # skips all usermod/chown, execs the app directly. @@ -116,18 +113,18 @@ if [ "$(id -u)" -ne 0 ]; then # if the user has also supplied PUID or PGID, let them know they need to use one or the other if [ -n "${PUID}" ] || [ -n "${PGID}" ]; then echo "ERROR: PUID/PGID are set but the container is running as a non-root user (using --user or user:)." - echo "Use one or the other, not both. Remove --user and set PUID/PGID, or remove PUID/PGID and use --user." + echo "Use one or the other, not both. Either remove --user and set PUID/PGID, or remove PUID/PGID and use --user." exit 1 fi - # exit if /app is not writable + # exit if /app is not writable; we can't fix this because we lack permissions if [ ! -r /app ] || [ ! -w /app ]; then - echo "ERROR: /app is not readable and/or writable by the current user ($(id -u):$(id -g))." - echo "When using --user, ensure the mounted directory is readable and writable by UID $(id -u)." + echo "ERROR: /app is not readable and/or writable by the current user ($(id -u):$(id -g)); currently owned by owned by $(stat -c '%U:%G (%u:%g)' /app)." + echo "To fix: chown -R $(id -u):$(id -g) /path/to/your/mounted/app/directory" exit 1 fi - # set umask and launch + # should be good to go; set umask and launch umask "$SLSKD_UMASK" exec "$@" fi @@ -147,21 +144,22 @@ if ! [[ "${PGID}" =~ ^[0-9]+$ ]]; then exit 1 fi -# update group -current_gid=$(getent group slskd | cut -d: -f3) -if [ "${current_gid}" != "${PGID}" ]; then - groupmod -o -g "${PGID}" slskd - usermod -g "${PGID}" slskd +# update group if needed +if [ "$(getent group slskd | cut -d: -f3)" != "$PGID" ]; then + groupmod -o -g "$PGID" slskd fi -# update user -current_uid=$(id -u slskd 2>/dev/null || echo "") -if [ "${current_uid}" != "${PUID}" ]; then - usermod -o -u "${PUID}" slskd +# update user if needed +if [ "$(id -u slskd)" != "$PUID" ] || [ "$(id -g slskd)" != "$PGID" ]; then + usermod -o -u "$PUID" -g "$PGID" slskd fi -# change owner of the directories we need to write -chown -R "${PUID}:${PGID}" /app +# change owner of the the /app directory if it isn't correct +# we're not checking anything other than the root, and we're not recursively +# applying the changes, which might be dangerous/unwanted and/or take forever +if [ "$(stat -c '%u:%g' /app)" != "${PUID}:${PGID}" ]; then + chown "${PUID}:${PGID}" /app +fi # set umask and launch umask "$SLSKD_UMASK" -- cgit v1.2.3 From 95e85cacce4f189e2bc894f81ff53a267e338381 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 18 Apr 2026 09:14:54 -0500 Subject: Update authors and vendor labels in Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index c1675229..6fbff9cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,8 +85,8 @@ ENV SHELL=/usr/bin/bash \ LABEL org.opencontainers.image.title=slskd \ org.opencontainers.image.description="A modern client-server application for the Soulseek file sharing network" \ - org.opencontainers.image.authors="slskd Team" \ - org.opencontainers.image.vendor="slskd Team" \ + org.opencontainers.image.authors="JP Dillingham, slskd Contributors" \ + org.opencontainers.image.vendor="slskd Project" \ org.opencontainers.image.licenses=AGPL-3.0 \ org.opencontainers.image.url=https://slskd.org \ org.opencontainers.image.source=https://github.com/slskd/slskd \ @@ -171,4 +171,4 @@ SCRIPT RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"] -CMD ["./slskd"] \ No newline at end of file +CMD ["./slskd"] -- cgit v1.2.3 From 6c11f81845a1f1e3c935f90dcf10f281a12c5e2e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 19 Apr 2026 10:51:23 -0500 Subject: add case for legacy docker behavior --- Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Dockerfile') 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}" -- cgit v1.2.3