Skip to content

uid collision on Centos 7 host #251

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

Closed
dangogh opened this issue Jan 19, 2017 · 6 comments
Closed

uid collision on Centos 7 host #251

dangogh opened this issue Jan 19, 2017 · 6 comments

Comments

@dangogh
Copy link

dangogh commented Jan 19, 2017

The hard-coded uid=999 value conflicts with the systemd-bus-proxy user on CentOS 7

$ grep :999: /etc/passwd
systemd-bus-proxy:x:999:997:systemd Bus Proxy:/:/sbin/nologin

This makes it difficult to use a volume mapped to a host directory as it is owned by the above user. Is there a recommended way to handle this?

@tianon
Copy link
Member

tianon commented Jan 19, 2017

One solution that will work the most generically is to look into Docker's User Namespaces support to see if it's a fit for your use case (which would allow you to remap the user directly as desired), but barring that, you'll likely be interested in #253. 👍

@dangogh
Copy link
Author

dangogh commented Jan 20, 2017

great responsiveness.. thanks! 👍

@beauremus
Copy link

I don't fully understand the solution. @dangogh what did you end up doing?

@dangogh
Copy link
Author

dangogh commented Jul 10, 2018

I ended up in the entrypoint script adding this bash function which sets the owner of the subdir I created to be the same as the volume I had mounted:

setowner() {
    own=$(stat -c '%u:%g' $1)
    shift
    [[ -n $@ ]] && chown -R ${own} "$@"
}
...
setowner /myvolume /myvolume/newsubdir

@beauremus
Copy link

Alright. Thanks for the response. Not happy with the hacky solution.

@dangogh
Copy link
Author

dangogh commented Jul 10, 2018

neither am I -- one hack on top of another, but sometimes it's what you can do

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