Skip to content
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

Missing ENV for PUID, PGID and UMASK #3

Closed
david-kalbermatten opened this issue Mar 15, 2022 · 4 comments
Closed

Missing ENV for PUID, PGID and UMASK #3

david-kalbermatten opened this issue Mar 15, 2022 · 4 comments

Comments

@david-kalbermatten
Copy link

david-kalbermatten commented Mar 15, 2022

Describe the bug
No option to change PUID, GUID and UMASK. This makes it hard to have it work nicely with the rest of the system. Other than that It seems to work really well, great job on the container!

To Reproduce
Steps to reproduce the behaviour:

  1. Run the docker container
  2. check permissions of created files with ls -la

Expected behavior
Most bigger docker images offer you the option to set the PUID, GUID and UMASK with environment variables, which gives you the information needed inside of the image.

Screenshots
What the permissions look like by default
image
What I need it to be for it to work nicely with Unraid (PID=99, GIP=100, UMASK=000)
image

Server:

  • OS: Unriad
  • Browser: NA
  • Version: v0.0.1

Additional context
I'm running Unraid on my server. Unraid uses the user "nobody" and the group "users" for all files with a UMASK of 000. This works with multiple users because the group and everyone have rw-access. The user can be different depending on which user wrote files to the share but the group is always the same, thus ensuring easy access to files without having to mess with the shell every time.

@david-kalbermatten david-kalbermatten changed the title Missing ENV for PID, GID and UMASK Missing ENV for PUID, GUID and UMASK Mar 16, 2022
@david-kalbermatten david-kalbermatten changed the title Missing ENV for PUID, GUID and UMASK Missing ENV for PUID, PGID and UMASK Mar 18, 2022
@david-kalbermatten
Copy link
Author

It would seem that PUID and PGID can be set. (My bad, didn't actually try to add the env-vars because they weren't listed in the documentation of this docker)

However, I cannot get the UMASK working, which is important to define what permissions the files created by the docker should have i.e. UMASK of 000 results in files with 666 whereas 022 results in files with 644 which interferes with the permission system of my host OS (Unraid).

@sytone
Copy link
Owner

sytone commented Mar 19, 2022

So UMASK cannot be set by default in the images I am using. Updated the docs with PUID and PGID.

For masking I usually set the bit in the host file system as I have never had a great time with containers doing the right thing.

So I set 2766 on the root folders on the host for the mapped volume and that ensure the permissions are replicated correctly.

@david-kalbermatten
Copy link
Author

So UMASK cannot be set by default in the images I am using. Updated the docs with PUID and PGID.

For masking I usually set the bit in the host file system as I have never had a great time with containers doing the right thing.

So I set 2766 on the root folders on the host for the mapped volume and that ensure the permissions are replicated correctly.

Sorry to be a bother, but can you elaborate on this? What commands would I have to use to do this? I have a similar issue with the Nextcloud docker image....

I would have to be able to force the container to write files with 666 and folders with 777. Right now I'm running a cron-job periodically to adjust the permissions but that obviously isn't a great solution.

Any links/insights would be highly appreciated!

@sytone
Copy link
Owner

sytone commented Mar 19, 2022

The joys of the Linux file system. I would like to introduce you to the SUID, GUID and Sticky Bit. Yes, that was my thought as well...

I set the GUID on directories so any files created in the directory will have their group ownership set to that of the directory owner. You can also run chmod g+S foldername. I much prefer the windows permission model as it makes these scenarios much simpler.

Read through these for background:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants