how to provide sudo permission to a user in dockerfile

Solved1.10K viewsDockerdocker dockerfile

how to provide sudo permission to a user in dockerfile

How can I create a user in dockerfile and provide sudo permission to it

Share:
vito Selected answer as best September 21, 2021
2

Below is what you need to do

# Pull an image
FROM ubuntu
# Add a new user "mark" with user id 8787
RUN useradd -u 8787 mark
# Provide root privileges to this user
RUN usermod -aG sudo mark
# Change user
USER john

Share:
vito Selected answer as best September 21, 2021
0