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

Possible to have Docker environment variable to set UID / GID? #69

Closed
richardpowellus opened this issue May 3, 2018 · 2 comments
Closed

Comments

@richardpowellus
Copy link

I would like to be able to control the user transmission-rss runs at in my Docker container so that I can give read only access to only that user to my transmission-rss.conf file.

Right now it looks like it just runs with UID 1000.

Or is there a different way I can accomplish this?

@nning nning closed this as completed in 8a70489 Jun 16, 2018
@nning
Copy link
Owner

nning commented Jun 16, 2018

Hey,

thank you very much for your suggestion!

I changed the Dockerfile to make it possible to specify the UID/GID by --build-arg. So currently it is not possible to set the UID/GID an runtime.

You can build a docker image with custom UID/GID with the following command:

docker build -t transmission-rss --build-arg UID=1337 --build-arg GID=1337 .

And then run the image with this command, for example:

docker run -it -v $(pwd)/transmission-rss.conf:/etc/transmission-rss.conf transmission-rss

In my tests everything worked with a transmission-rss.conf that was owned by the specified UID/GID and chmod 600.

Let me know, if it works for you!

Best regards,
henning

@reconman
Copy link

reconman commented Jan 7, 2021

I found this issue while looking for one addressing my current issue.

Docker has a native support for --user=uid:guid. Don't use the user and group names as those would have to be specified when building the image.

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

3 participants