I'm trying to create a new user with UID
1340816314
inside an Alpine Linux Docker container in order to have a user with an UID
matching a specific user on the host.
The problem is that I'm facing adduser: number 1340816314 is not in 0..256000 range
even if I redefine the value of UID_MAX
inside /etc/login.defs
by following adduser man page. I don't think by the way that it has any impact as the adduser
command in Alpine is from BusyBox.
Here is the log of what I try to do:
$ docker run -it --rm alpine:3.4 sh
/ # adduser -D -g '' -u 1340816314 user
adduser: number 1340816314 is not in 0..256000 range
/ # echo "UID_MAX 1340816314" > /etc/login.defs
/ # adduser -D -g '' -u 1340816314 user
adduser: number 1340816314 is not in 0..256000 range
/ # echo "UID_MAX 1340816315" > /etc/login.defs
/ # adduser -D -g '' -u 1340816314 user
adduser: number 1340816314 is not in 0..256000 range
Do you know how to add a user with a large UID
in Alpine Linux inside a Docker container?
busybox
adduser, which may simply be limited in the maximum value it supports. The man page you're reading isn't necessarily the correct one (other distributions have anadduser
command which is not the same as the one provided by busybox). – Hydrophobic