feat(docker): honor PUID/PGID for Unraid nobody:users ownership - #256
Merged
Conversation
The container hardcoded UID 1001, so files written to mounted appdata were owned by 1001 rather than Unraid's nobody:users (99:100), causing permission friction (discussion #255). The entrypoint now reads PUID/PGID (default 1001, preserving prior behaviour), chowns the writable paths (/app/jobs, /cache, settings.json) to them, and drops to that UID:GID via gosu. Expose PUID=99 / PGID=100 as template variables so Unraid installs get correct ownership out of the box.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the container honor
PUID/PGIDso files written to mounted appdata are owned by the requested user. On Unraid that'snobody:users(99:100). Addresses discussion #255.Why
The container hardcoded UID 1001 (
gosu app). SettingPUID/PGIDdid nothing, so appdata files came out owned by 1001 - the exact ownership friction raised in #255.Changes
PUID/PGID(default 1001, so plaindocker runis unchanged),chownthe writable paths to them, thengosu ${PUID}:${PGID}.PUID(default 99) andPGID(default 100) variables.Why only those paths get chowned
Traced every runtime write: registry.json, downloaded audio, and stems all land under
/app/jobs; torch/Demucs weights under/cache; best-effort settings in/app/settings.json. App code and the venv under/appstay world-readable, so a non-1001 UID can still import and run them. No Dockerfile change needed - the entrypoint runs as root (noUSERdirective) andgosuaccepts a numeric UID:GID.Verify
Unset PUID/PGID -> runs as 1001 (unchanged).