I was naively expecting this command to run a bash shell in a running container :
docker run "id of running container" /bin/bash
it looks like it's not possible, I get the error :
2013/07/27 20:00:24 Internal server error: 404 trying to fetch remote history for 27d757283842
So, if I want to run bash shell in a running container (ex. for diagnosis purposes)
do I have to run an SSH server in it and loggin via ssh ?
You need an SSH server to get a bash shell inside a container.
In order to start a Bash shell in a Docker container, execute the “docker exec” command with the “-it” option and specify the container ID as well as the path to the bash shell. If the Bash is part of your PATH, you can simply type “bash” and have a Bash terminal in your container.
Step 1: Enable remote access for a containerLocate and select the desired workload. Navigate to Manage Your Instances, and then use the slider to enable Remote Management. Above Manage Your Instances, navigate to Instances, and then select the desired instance.
With docker 1.3, there is a new command docker exec
. This allows you to enter a running docker:
docker exec -it "id of running container" bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With