-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Docker containers can conflict with users on host system in Linux 3.15 #6345
Copy link
Copy link
Closed
Labels
Description
Creating a new user in a docker container via the adduser command will cause an error if the user already exists on the host system and the command is used with the --gecos flag to supply finger information. This command is commonly run by package managers to create non-privileged users for daemons (e.g. mysql, postgresql).
Expected result:
A new user is created in docker container regardless of whether or not it already exists in the host system.
Actual Result:
Creating a new user fails with the error
chfn: PAM: System error
adduser: `/usr/bin/chfn -f PostgreSQL administrator postgres' returned error code 1. Exiting.
Steps to Reproduce:
- Install the Linux 3.15 kernel on the host machine
- Run the following command, replacing "postgres" with any user that exists on the host machine
docker run -i -t ubuntu adduser --system --quiet --home /var/lib/postgresql --no-create-home \
--shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
Reactions are currently unavailable