KansaiRobot
KansaiRobot

Reputation: 9912

Is there a way to reintroduce yourself to a docker container running bash?

Let's say I have one docker container that when run it finishes with bash. So after docker run I have a bash terminal and I can put commands.

If for some reason I lost contact to this terminal (it can happen) and then in another terminal, I do docker ps, I can see the container running. However I am not "inside" the bash of this docker

Right now what I do is to delete this and then run docker run again but is there a way I can rejoin the terminal of this running container?

Upvotes: 0

Views: 42

Answers (1)

Kamoo
Kamoo

Reputation: 872

You can "detach" from a container without closing the program by Ctrl-P + Ctrl-Q

docker run -it -d --entrypoint sh busybox

docker attach $container_id

/ # #inside container, use Ctrl-p Ctrl-q to detach


Upvotes: 1

Related Questions