-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
[Docker] Environment variable: PUID and PGID #240
Comments
Do you have documentation on how to implement this with NextJS ? I'm not really familiary with the PUID and PGID variables and don't know how to leverage them once they are set. Links/PRs welcome! |
Not really. I don't even think it should be done by NextJS. Those are variables tied with docker environment. |
So how would I go about implementing the support of these env variables ? |
I know how to use environment variables with NextJS, that's how I implemented the password. Problem is that I don't know what the env variables OP suggests are supposed to be doing |
Their meaning is that they specifies with user would run the docker container so it's not needed to be run as Example: As PUID i will specify |
I don't think PUID and GUID has anything to with NextJS, as @Pheggas said it's just defining which user and group the docker container uses. I have no idea how to pass this to the actual container, but I'll do some research. |
Linuxserver seems to be using S6 to manage permissions. https://discourse.linuxserver.io/t/how-to-add-puid-pgid-function-into-docker-image/2474 |
@walkxcode I don't see a problem using Just need to document the benefits this change could offer |
Should be added with #317 |
hello, this does not seem to address the issue if I understand correctly ... root user is still used in container and config files are created with root.
content of conf folder :
|
Hello @ajnart this should be reopened because it's still an issue in version 0.11 :( |
Why has this not been fixed? @ajnart , you told me that it was fixed. I'm reopening this... |
problem was that environnement variables were not exported in the image. Like docker run -e PASSWORD something didn't work, I think the environment variables weren't passed to the user . Is anyone finds a fix please make a PR because I didn't find one |
Hey @ajnart, I may spend some time this week looking at this issue. May I ask why did you revert the base image change from Did something break with the linuxserver image? |
After a lot of searching, the current answer seems to be the user field. From my testing, this works with no problems, but I'd love if anyone that cares could try it out and maybe point out if something is missing. @nyok1912 Tagging you as you made the recent issue about it. |
That sounds very well, but i'm not understand, that is working for you? i'm trying with minimal compose and fresh folder without any data without success... |
You need to manually create the folders with the right permissions. |
As far as I can tell, everything should be running as the user you set. |
Not all works correct, docker integration is now not working:
Reason for keep synced user permission under each home folder is many when binded mount volumes based.
There will probably be more reasons I can remember in the future or other users tell more reasons for this, each time docker containers is more supporting this little feature. |
Yes that's because the permissions to the docker integration file might need to be root, which your container isn't in this case. As for the docker.sock, see if you can change the file's permissions somehow. |
I looked a bit, seems you only need to add the user to the docker group: I understand that you can't want to restrict access and at the same time give it full control over your docker. |
Uhm... change docker.sock permissions in host for addapt to each user is not good option... containerized app must be addapted for works with host resources keeping host rules, id's, etc... using customizable enviroment var to fine set working with host. I think Cointainer can have a supervisord to start processes and adjust internal user id and privileges, I have done this before with good result |
If you have any idea on how to implement this into homarr, you're welcome to contribute. |
Ok, let's me try! |
you have telegram? |
I would rather use discord if you're ok with it, this is where we converse within the community. |
Description
Hello. As i want to run more secure environment of my homelab, i don't want to run any docker container as root.
Suggestion: Every Linuxserver image has it's common environment variables like TZ (timezone), PUID (user ID of user that will run the container), PGID (group ID of user that will run the container). Those last two i'd like to see also in Homarr. Many docker images of countless projects have it.
Things i tried:
As i'm managing my container in Portainer Web UI, i needed to select different way of achieving user definition. Docker itself has
--user: 1000:1000
which defines which user will run the container.user
and value1000:1000
. However, this didn't work.Priority
High (App breaking feature)
Please tick the boxes
The text was updated successfully, but these errors were encountered: