Mail archive

[alpine-user] Docker add user pwd

From: Gabor Toth <>
Date: Mon, 9 Apr 2018 10:09:57 +0200

Dear All,

I am trying to add a user, and then set a password for the user in a
Dockerfile using node:8-alpine as base image, I am running the following
command, but when I run the container, the user has no password at the end:

#Add user

RUN ["adduser","-D","-s","/bin/bash", "admin"]
#Set pwd for user

#this is not working
RUN ["echo","admin:password","|", "chpasswd"]

So I am wondering what the best practice here. Thanks,


Received on Mon Apr 09 2018 - 10:09:57 UTC