Red Hat Bugzilla – Bug 1285045
Docker does not have a set/defined UID/GID
Last modified: 2016-06-07 11:01:17 EDT
Description of problem:
The docker service does not have a uniform / set UID/GID like other services.
How reproducible: 100%
Steps to Reproduce:
1. Install docker
A UID / GID is set based on what is avalabe at the time of the RPM install.
The UID/GID should be consistant as it is with other services out of /usr/share/doc/setup/uidgid
# grep docker /etc/passwd
# rpm -q docker --scripts
preinstall scriptlet (using /bin/sh):
getent passwd dockerroot > /dev/null || /usr/sbin/useradd -r -d /var/lib/docker -s /sbin/nologin -c "Docker User" dockerroot
How does one go about assigning a persistant UID for docker?
Er, no. Not every RPM gets a fixed uid, it simply would not scale.
If you're using RPMs-assembled-on-client (e.g. yum) you can simply `useradd` before installing the RPM and choose whatever name -> uid mappings you desire.
If you're using Atomic Host, this is done for you.
Great Colin, thanks, did not know that info.
Currently the dockerroot user is not used by anything other then locally on the system to separate root user within the container from root user on the host. Theoretically this should never leave the host, but I guess could if you were using shared volumes into containers which you wanted owned by dockerroot.
Eric any movement on this?
(In reply to Daniel Walsh from comment #8)
> Eric any movement on this?
Dan I'm confused on the question. The bug was re-opened, given that we have an inconsistency with products that do and do not set UID/GID values for services.
Does engineering have any objections to setting a default value for the UID/GID for docker?
I agree with Colin that there is no need to make this consistent across docker instances. we are not currently sharing it over shared network storage. So I am closing this as wontfix.