Bug 1285045

Summary: Docker does not have a set/defined UID/GID
Product: Red Hat Enterprise Linux 7 Reporter: Eric Rich <erich>
Component: dockerAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: atomic-bugs, dwalsh, erich, jchaloup, lsm5, pasik, walters
Target Milestone: rcKeywords: Extras, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1285041 Environment:
Last Closed: 2016-06-07 15:01:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Rich 2015-11-24 18:06:21 UTC
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

Actual results:

A UID / GID is set based on what is avalabe at the time of the RPM install. 

Expected results:

The UID/GID should be consistant as it is with other services out of /usr/share/doc/setup/uidgid

Additional info:

# grep docker /etc/passwd
dockerroot:x:997:995:Docker User:/var/lib/docker:/sbin/nologin

# 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
...

Comment 1 Daniel Walsh 2015-11-24 18:20:18 UTC
How does one go about assigning a persistant UID for docker?

Comment 2 Colin Walters 2015-11-24 18:45:54 UTC
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.

Comment 3 Daniel Walsh 2015-11-24 18:48:02 UTC
Great Colin, thanks, did not know that info.

Comment 5 Daniel Walsh 2015-11-24 19:44:53 UTC
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.

Comment 8 Daniel Walsh 2016-06-03 13:02:07 UTC
Eric any movement on this?

Comment 9 Eric Rich 2016-06-06 16:19:41 UTC
(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?

Comment 10 Daniel Walsh 2016-06-07 15:01:17 UTC
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.