Privileges in Ubuntu Docker container after USER statement in Dockerfile

I created a Dockerfile

FROM       ubuntu:latest

as the source image.

Dockerfile later creates a new group and user without sudo privileges through

RUN groupadd -r myappuser -g 433
RUN useradd -u 431 -r -g myappuser -d /opt/myapp -s /bin/false -c "my app user" myappuser

Before running the application, I will switch to this new

USER       myappuser

Question: Does this parameter allow root privileges to be obtained again after creating the image and starting the container (for example docker exec -it)?

+4
source share
1 answer

sudo, Dockerfile USER ( root) CMD script, , , docker exec root.

- root su. - tutum

https://github.com/tutumcloud/tutum-centos/blob/master/set_root_pw.sh

+3

All Articles