Docker: add new user in Alpine Linux
If you want to create a new user within a Dockerfile for an Alpine Linux, useradd won’t work. You have to use adduser
.
This command will work
adduser -h /home/userx -g groupx -S userx
Please mind to add the -S (uppercase!!). If you omit this, Alpine ask interactively for a password. Interestingly, the option --disabled-password
does not work!?!?