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

Use a fixed uid and gid #53

Closed
RussellMcOrmond opened this issue Dec 21, 2017 · 5 comments · Fixed by #64
Closed

Use a fixed uid and gid #53

RussellMcOrmond opened this issue Dec 21, 2017 · 5 comments · Fixed by #64

Comments

@RussellMcOrmond
Copy link

Currently the Dockerfile uses:

groupadd -r couchdb && useradd -d /var/lib/couchdb -g couchdb couchdb

So that externally mounted directories can maintain the correct permissions, and 'ps' and other tools on the host show the IDs correctly, it would be ideal if a fixed uid and gid were assigned rather than the default of using the next available id's.

@wohali
Copy link
Member

wohali commented Jan 17, 2018

Paging @tianon . What is the best practice on uid/gids when it comes to Docker? I've seen this issue many times over and see plusses and minuses to @RussellMcOrmond 's suggestion.

@tianon
Copy link

tianon commented Jan 17, 2018

So, doing groupadd and/or useradd in this way is really common, but it does simply grab the next available at the time of build, which we've seen change between Alpine releases, for example (since the default list of users/groups sometimes changes).

Making the exact IDs used explicit is generally a good idea for future compatibility. 👍

@tianon
Copy link

tianon commented Jan 17, 2018

(The difficult part is choosing good ones that aren't likely to overlap with new additions to the base in the future.)

@RussellMcOrmond
Copy link
Author

What the Solr image does is use the default port number for the uid/gid as well. If there is a conflict in future, it will be known and users can be informed of any changes in documentation.

@wohali
Copy link
Member

wohali commented Jan 31, 2018

@RussellMcOrmond That's a good idea, thanks.

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

Successfully merging a pull request may close this issue.

3 participants