Skip to content

Commit 69f5033

Browse files
authored
Merge pull request #501 from cgwalters/more-user-group
users-and-groups: Document useradd httpd more
2 parents caaa64d + 94fa34b commit 69f5033

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

docs/src/building/users-and-groups.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,22 @@ users and credentials as part of a derived build:
6464
RUN useradd someuser
6565
```
6666

67-
However, it is important to understand some issues with the default
68-
`shadow-utils` implementation of `useradd`:
69-
70-
First, typically user/group IDs are allocated dynamically, and this can result in "drift" (see below).
67+
However, it is important to understand some two very important issues
68+
with this as it exists today (the `shadow-utils` implementation of `useradd`)
69+
and the default glibc `files` backend for the traditional `/etc/passwd`
70+
and `/etc/shadow` files.
71+
72+
It is common for user/group IDs are allocated dynamically, and this can result in "drift" (see below).
73+
74+
Further, if `/etc/passwd` is modified locally (because there is a machine-local user),
75+
then any added users injected via `useradd` *will not appear* on subsequent updates by default (they will be
76+
in `/usr/etc/passwd` instead - the default image version).
77+
78+
These "system users" that may be created by packaging tools invoking `useradd` (e.g. `apt|dnf install httpd`) that do
79+
not also install a `sysusers.d` file. Currently for example, this is the case with
80+
the CentOS Stream 9 `httpd` package. Per below, the general solution to this
81+
is to avoid invoking `useradd` in container builds, and prefer one of the below
82+
solutions.
7183

7284
#### User and group home directories and `/var`
7385

0 commit comments

Comments
 (0)