From ca3e2f316c896ac145ccd37bfe7a9f68a9600f17 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 22 Apr 2025 08:19:10 -0400 Subject: [PATCH] PUID/PGID changes --- CHANGELOG.md | 1 + Dockerfile | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e74c44a..50b1e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - `www‑data` user is remapped at build‑time to the supplied `PUID:PGID`, then Apache drops privileges to that user - Unraid template: removed recommendation to use `--user`; replaced with `PUID`, `PGID`, and `Container Port` variables - “Permission denied” errors when forcing `--user 99:100` on Unraid by ensuring startup runs as root +- Silence group issue --- diff --git a/Dockerfile b/Dockerfile index c2fc843..edfabef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,8 +66,15 @@ RUN apt-get update && \ # Remap www-data to the PUID/PGID provided RUN set -eux; \ - if [ "$(id -u www-data)" != "${PUID}" ]; then usermod -u "${PUID}" www-data; fi; \ - if [ "$(id -g www-data)" != "${PGID}" ]; then groupmod -g "${PGID}" www-data; fi; \ + # only change the UID if it’s not already correct + if [ "$(id -u www-data)" != "${PUID}" ]; then \ + usermod -u "${PUID}" www-data; \ + fi; \ + # attempt to change the GID, but ignore “already exists” errors + if [ "$(id -g www-data)" != "${PGID}" ]; then \ + groupmod -g "${PGID}" www-data 2>/dev/null || true; \ + fi; \ + # finally set www-data’s primary group to PGID (will succeed if the group exists) usermod -g "${PGID}" www-data # Copy application tuning and code