Can't attach terminal to a running container in docker

I’m giving a try to :

  • replication controller in docker swarm world
  • How stop service jira in docker for updating jira?
  • Chokidar isn't picking up file changes inside docker container
  • Docker CPU percentage
  • How to forward port on running vagrant box
  • How to protect a web application running in a Docker container by username and password?
  • 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 ?


  • How to export a named docker volume on a Mac?
  • Docker Compose: Change env variables
  • Should Swarm Master Join As Node in a Single Node Cluster?
  • How do I wait for a pull?
  • Local Wordpress env with Docker Compose - cURL error 7: Failed to connect to localhost port 8080: Connection refused
  • Elastic Beanstalk, Docker and Continuous integration
  • One Solution collect form web for “Can't attach terminal to a running container in docker”

    First, the 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:

    1. Start the docker daemon in TCP mode (docker -d -H tcp://) WARNING: Insecure.
    2. Put the correct host/port in Docker-Terminal’s index.html in data-docker-terminal-host (the port is 4243)
    3. Start a container
    4. Put the ID of the running container you want to attach to in data-docker-terminal-container still in Docker-Terminal’s index.html
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.