RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1285045 - Docker does not have a set/defined UID/GID
Summary: Docker does not have a set/defined UID/GID
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-24 18:06 UTC by Eric Rich
Modified: 2020-03-26 16:09 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1285041
Environment:
Last Closed: 2016-06-07 15:01:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.