-
Notifications
You must be signed in to change notification settings - Fork 348
User id mapping between host and container #78
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
Conversation
|
Looks very promising. Two comments: You should use Docker build args ( Long |
|
These are some top tips, thank you! In this case, however, I would rather leave these for the next iteration, as a refactoring step. This patch already introduces at least 3 significant dependencies and may not be particularly easy to reason about. It's also made trickier by the fact that the files are auto-generated from templates. |
|
Can we merge this? |
|
I have been testing the change and realised that it is a bad idea to Starting from uid let's create the volumes and populate a sample configuration file to mount over the defaults in the container Let's also drop some permissions on the config file which is a likely use case At this point container could be started successfully without specifying Now we create a new user and set ownership accordingly (note: user name could be anything else here, it is the id that matters) If we now run the container with the default The above was verified both for |
|
@repeatedly as far as could be ascertained, this should be working as expected. There certainly are areas for improvement, such as, using tini instead of dumb-init for alpine images, not running dumb-init itself as root (although this is not something done commonly in a number of official images), using exec form of CMD to avoid spawning an extra shell process, as well as everything mentioned by @atombender above.. however, perhaps those could be tackled separately at some point. |
|
@ValFadeev Out of curiosity, why are gosu and dumb-init not installed here via apk / apt-get ? |
|
@StevenACoffman |
|
@repeatedly do you think this one could be merged some time? It keeps falling behind on version which causes conflicts. I have this deployed in my staging environment, so far everything is as expected |
|
@repeatedly it works in our environment as well, and is a high quality, high value improvement. I would also like to see it merged. |
|
Sorry for the late. I took 10 days vacation. Thanks for the testing. I will merge this patch tomorrow. |
|
Sorry for the late but just merged! |
This patch builds on the good work done under #60 and addresses #36, #48 and #77.
entrypoint.sh.erbhas been added to automate generation of the script for all availabe distros/versionsDockerfile.template.erbhas been modified, adding dependencies forgosu,su-execanddumb-initas appropriateAn excellent walkthrough explaining the tricks and pitfalls of docker user mapping can be found here. Also, here is a nice introduction into
dumb-initand the problems it solves.