-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting PUID/PGID? #36
Comments
Running I think we'd have three options:
The first option would probably be the best, but then I am not sure about the breaking change. |
I guess it'd be a bad idea to run a script with cron and change user? sudo -u anotherUser touch /my/nas/storage/archive.tar.gz Otherwise maybe Linuxserver can be helpful, they use Alpine and PUID/PGID. |
This is basically what approach 1 is. It's not super pretty, but maybe it's the tool for the job here. This method would need to be taught how to copy to a src with a different user: docker-volume-backup/cmd/backup/main.go Lines 682 to 701 in 5a6ce81
What's interesting is that
The Linuxserver docs state: "We are aware that recent versions of the Docker engine have introduced the --user flag. Our images are not yet compatible with this, so we recommend continuing usage of PUID and PGID." so maybe this Docker native behavior should be the way to implement this correctly if you have never supported it until now. That being said, it would definitely be a breaking change as consumer would either have to adjust things after updating or get files owned by a different user. Also, I'm not entirely sure if this even works as expected as I get files owned by
|
I spoke to LinuxServer, and it seems you need to run the commands as abc to access the PUID/PGIDs. I don't know if this complicates things.
|
Thanks for finding this out. This creates the same "problems" as in option 1 as we'd have to make By now I think using Docker's |
As you said, using a native --user flag might be the best solution. |
This turns out to be highly complicated. The user inside of the container will possibly interact with the host's Docker daemon, so it will require root privileges for doing so. Getting all of this mapped correctly will be very hard so I might need to start thinking about the chown on copy solution again. |
This is turning into a serious rabbit hole and by now I'm not even sure if it's possible to cover your requirements considering the user inside the container will need to interact with the Docker daemon. In any case I hacked together a test version that uses Would it be possible for you @sfkpmr to build an image off that branch and try using it in your setup (setting BACKUP_UID and BACKUP_GID)? I'm not entirely sure if this works as I surmise |
Closing this as inactive. Feel free to reopen in case you want to look into this further. |
Would it be possible to add the ability to change PUID and PGID?
I'd like to put my local archive on a NAS, but my file permissions doesn't allow root to put the files there.
The text was updated successfully, but these errors were encountered: