Can't attach terminal to a running container in docker

I’m giving a try to :

  • Docker container automation on the cloud
  • headless watir webdriver tests unable to find firefox
  • Docker postgres does not run init file in docker-entrypoint-initdb.d
  • Reducing the shipping time in continuous delivery, especially in hotfix
  • How do I save kubectl logs to a file on my host machine?
  • libgit2 alpine linux docker error
  • 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 generate a Postgresql Dump from a Docker container?
  • Getting console output from Docker container
  • docker, nginx, django and how to serve static files
  • Docker Compose Expose Spark Worker UI Ports Dynamically to Host When Scaling
  • Why does apt-get exit without an error during Dockerfile build?
  • traefik reverse-proxy with docker backend - configure frontend rules in traefik's config file and not via container label
  • 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.