Can't attach terminal to a running container in docker
I’m giving a try to :
I have turned docker to listen tcp; so i have successfully opened port 4242 (-d -H=tcp://localhost:4242); I run a bare container:
docker pull dhrp/sshd
And then ran:
docker run -d -t dhrp/sshd
I can see the container running; but when I attach to it (using Docker Terminal) it shows : Session started and then nothing.
What am I doing wrong here ?
One Solution collect form web for “Can't attach terminal to a running container in docker”
dhrp/sshd image will start a ssh server. There is no point in attaching to it. You can ssh to it.
If you want to attach to a running container, you need to do a couple of things:
- Start the docker daemon in TCP mode (
docker -d -H tcp://) WARNING: Insecure.
- Put the correct host/port in Docker-Terminal’s index.html in
data-docker-terminal-host(the port is 4243)
- Start a container
- Put the ID of the running container you want to attach to in
data-docker-terminal-containerstill in Docker-Terminal’s index.html