Comment 2 for bug 1754562

Revision history for this message
Tianon Gravi (tianon) wrote :

I'm guessing you added the group as a non-system group?
(resulting in "addgroup: The group `docker' already exists and is not a system group. Exiting.")

I think it would probably be sane to add a check similar to the one Docker itself uses (namely whether "/etc/group" includes a line that starts with "docker:" -- ie, not using "getent group" since Docker parses the file directly).

something like:

| if ! grep -q '^docker:' /etc/group 2>/dev/null; then
| addgroup --system docker
| fi

---

See also:

https://github.com/moby/moby/blob/3a633a712c8bbb863fe7e57ec132dd87a9c4eff7/daemon/listeners/group_unix.go#L20

https://github.com/opencontainers/runc/blob/69663f0bd4b60df09991c08812a60108003fa340/libcontainer/user/lookup_unix.go#L15