I want to ssh or bash into a running docker container. Please, see example:
$ sudo docker run -d webserver
webserver is clean image from ubuntu:14.04
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
665b4a1e17b6 webserver:latest /bin/bash ... ... 22/tcp, 80/tcp loving_heisenberg
Now I want to get something like this (go into the running container):
$ sudo docker run -t -i webserver
(or maybe 665b4a1e17b6
instead)
$ root@665b4a1e17b6:/#
However when I run the line above I get new CONTAINER ID:
$ root@42f1e37bd0e5:/#
I used Vagrant and I'd like to get a similar behaviour as vagrant ssh
.