Source From Here
Question
I want to ssh or bash into running docker container. Please, see example:
Now I want to get something like this (go into running container):
Previously I used Vagrant so I want to get behavior similar to vagrant ssh. Please, could anyone help me?
How-To
The answer is docker's attach command. So for my example above the solution will:
UPDATE: (docker >= 1.3) Thanks to WiR3D user who suggested another way to get container's shell. If we use attach we can use only one instance of shell. So if we want open new terminal with new instance of container's shell, we just need run the following:
Question
I want to ssh or bash into running docker container. Please, see example:
Now I want to get something like this (go into running container):
Previously I used Vagrant so I want to get behavior similar to vagrant ssh. Please, could anyone help me?
How-To
The answer is docker's attach command. So for my example above the solution will:
UPDATE: (docker >= 1.3) Thanks to WiR3D user who suggested another way to get container's shell. If we use attach we can use only one instance of shell. So if we want open new terminal with new instance of container's shell, we just need run the following:
沒有留言:
張貼留言