(TIL) Docker: Start Container as Root User

less than 1 minute read

When sudo is not available in container, you can jump into a running container as root user using one of these commands:

docker exec -u root -t -i container_id /bin/bash

docker-compose run -u root --service-ports service_name exec bash

Tags: ,

Categories:

Updated:

Comments