-
Notifications
You must be signed in to change notification settings - Fork 649
Mongo user in dockerfile added as default system user uid. #181
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
Comments
While the mongo user is user 999, it can only access things given to it inside the container. #81 added the ability to run as an arbitrary user, |
in this case. user 999 can access the container tho right. i guess we'll go with a random uid then. thanks. |
@yosifkit getting this running as another user
i'm not using a host volume does the startup handle chowning the data directory to the user passed it? |
It cannot chown. If you start the container with We did add some notes for arbitrary users in postgres, but have not added anything for mongo, mysql, mariadb, or percona. |
in that case, think id prefer to run it as the user starting the container, however in that case that user needs to exist in the container then |
Old thread, but posting the solution in case someone finds it useful. Currently, it has different options to get this working, but you need to justify your case. For example, in my case, the data volume is mapped to the mongodb docker container created using official mongodb docker image, it always creates the mongodb user with uid=999 and gid=999, which translates to the following problem. Problem
Solution |
If someone comes across this again: Greetings |
If that's really necessary, wouldn't something like this be simpler? FROM mongo:6
RUN set -eux; \
groupmod --gid 1234 mongodb; \
usermod --uid 1234 mongodb (At most, then adding |
Could be a simpler solution, yes. Will test it. |
Tested and added the option + examples to my repo. |
The dockerfile adds mongodb user as system user which in turn creates a user with a uid of 999.
On our host we happen to have another default system user with a uid of 999.
When we run the docker container it gets mapped to this user.
I'm wondering what people have done to get around this. Basically the container has all the rights of the mapped user now.
The text was updated successfully, but these errors were encountered: