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

Add PUID, PGID support for Docker #2525

Closed
4 tasks done
JJPro opened this issue Nov 29, 2022 · 2 comments · Fixed by #2818
Closed
4 tasks done

Add PUID, PGID support for Docker #2525

JJPro opened this issue Nov 29, 2022 · 2 comments · Fixed by #2818
Labels
enhancement New feature or request

Comments

@JJPro
Copy link

JJPro commented Nov 29, 2022

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

Files saved to Local (bind mount) are owned by root, which is inaccessible by me.
Have to manually run chown on those files.

Can you add support for PUID & PGID env vars like linuxserver.io images did?
So those files will be owned by me as a default behavior.

A workaround for now is to use --user $(id -u):$(id -g) when creating containers.

But this approach causes another problem:

when using named volume for /opt/data, using --user approach will cause permission error when alist program access /opt/data, since named volumes are owned by root.

Suggested solution / 实现思路

TBH, I don't know how linuxserver.io team's PUID approach works exactly.

I suspect they run a script to create user with given PID and UID on container creation. And it's that user that owns the application process.

Additional context / 附件

No response

@JJPro JJPro added the enhancement New feature or request label Nov 29, 2022
@welcome
Copy link

welcome bot commented Nov 29, 2022

Thanks for opening your first issue here! Be sure to follow the issue template!

@BoYanZh
Copy link
Contributor

BoYanZh commented Dec 25, 2022

xhofe pushed a commit that referenced this issue Dec 28, 2022
… pr #2818)

Co-authored-by: DDSRem <1448139087@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants