How can I get the password of the docker root container

How can I get the password of the docker root container?

[ root@localhost train02]# docker exec -it jenkins /bin/bash [ jenkins@89d5aa94e6ec /]ls /root ls:cannot open directory /root: Permission denied 
+6
source share
1 answer

If you are using docker ( > = 1.7.0 ), go -u to docker exec :

 docker exec -it -u root jenkins /bin/bash 

It will run / bin / bash as the root user.

+22
source

All Articles