abraunegg-onedrive/contrib/docker
abraunegg 20e70cd062
Fix Bug #3601: Fix Docker entrypoint handling for non-root --user execution (#3602)
* Fix Docker entrypoint handling for non-root --user execution

This change updates the Docker entrypoint.sh to correctly support containers started with a numeric UID/GID via --user or user: (Docker Compose).

Previously, the entrypoint unconditionally attempted user and group management (useradd, groupadd, usermod) before checking whether the container was running as root. When the container was started as a non-root user, this resulted in immediate startup failures due to insufficient privileges.

The updated logic now:

* Detects whether the container is started as root or non-root
* Skips all user/group creation and ownership changes when running as non-root
* Treats --user / user: as authoritative when provided
* Preserves existing behaviour when the container is started as root (including optional privilege drop via gosu)
* Ensures ONEDRIVE_RUNAS_ROOT is only honoured when the container is actually running as root

This makes the container compatible with:

* Numeric UID/GID execution
* NFS-backed volumes where the user does not exist on the host
* Read-only bind mounts for upload-only scenarios

No changes are made to the OneDrive client itself; this update strictly improves container startup behaviour and correctness.
2026-01-11 07:12:58 +11:00
..
hooks Add date tag on docker.hub (#584) 2019-07-14 08:37:24 +10:00
Dockerfile Update Dockerfiles December 2025 (#3565) 2025-12-12 15:18:05 +11:00
Dockerfile-alpine Update Dockerfiles December 2025 (#3565) 2025-12-12 15:18:05 +11:00
Dockerfile-debian Update Dockerfiles December 2025 (#3565) 2025-12-12 15:18:05 +11:00
entrypoint.sh Fix Bug #3601: Fix Docker entrypoint handling for non-root --user execution (#3602) 2026-01-11 07:12:58 +11:00