lolski
lolski

Reputation: 17491

Specifying the creation of a sudo user in a Dockerfile?

I want my Docker image to have a non-root user that can perform root/sudo commands.

How do I specify that in my Dockerfile?

Upvotes: 1

Views: 172

Answers (1)

lolski
lolski

Reputation: 17491

I found out by myself:

RUN useradd -m <username>
RUN sudo usermod -a -G sudo <username>
RUN echo "<username>:<password>"|chpasswd

Upvotes: 1

Related Questions