Friday, July 22, 2022

[FIXED] How to run /bin/bash in a docker container?

Issue

How to run /bin/bash in a docker container that was started with the -d option, for example:

sudo docker run -P --name test-cnt3 -d base-tst:0.1? 

I really need a console in the container and I already despaired of running it


Solution

Use docker exec to run a command in an already running container, use -it to create a new interactive pseudo-TTY:

docker exec -it test-cnt3 /bin/bash


Answered By - Paul
Answer Checked By - Cary Denson (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.