Mail archive
alpine-user

[alpine-user] Docker add user pwd

From: Gabor Toth <gabor.toth_at_maximilianeum.de>
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,

Gabor



---
Unsubscribe:  alpine-user+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-user+help_at_lists.alpinelinux.org
---
Received on Mon Apr 09 2018 - 10:09:57 UTC