PUID/PGID changes
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
- `www‑data` user is remapped at build‑time to the supplied `PUID:PGID`, then Apache drops privileges to that user
|
- `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
|
- 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
|
- “Permission denied” errors when forcing `--user 99:100` on Unraid by ensuring startup runs as root
|
||||||
|
- Silence group issue
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -66,8 +66,15 @@ RUN apt-get update && \
|
|||||||
|
|
||||||
# Remap www-data to the PUID/PGID provided
|
# Remap www-data to the PUID/PGID provided
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
if [ "$(id -u www-data)" != "${PUID}" ]; then usermod -u "${PUID}" www-data; fi; \
|
# only change the UID if it’s not already correct
|
||||||
if [ "$(id -g www-data)" != "${PGID}" ]; then groupmod -g "${PGID}" www-data; fi; \
|
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
|
usermod -g "${PGID}" www-data
|
||||||
|
|
||||||
# Copy application tuning and code
|
# Copy application tuning and code
|
||||||
|
|||||||
Reference in New Issue
Block a user