Sunday, 20 August 2017

login to existing docker container as root


Run the following command from the host machine:
docker exec -itu 0 <container name or id> bash

Explanation:
The -i option means this session should be interactive
The -t option means attach the session to a tty
The -u 0 option means run the session as uid zero, which is of course root
And finally the command to run in this case is bash




No comments:

Post a Comment