docker-machine – connection refused error

I’m using docker-machine, docker-compose on mac OS to start up my container.

In my docker-compose.yml, i have

  • Docker Exec command does not work properly
  • How to see the logs of running application inside docker container?
  • How to set a time limit for a Kubernetes job?
  • Accessing Site Behind nginx-proxy via IP Address
  • Migrating a service from one docker container to another with zero downtime
  • How to force a docker push on mac osx
  • ports:
        - "8080:8080"
    expose:
        - "3000"
        - "8000"
        - "8080"
    

    Steps to create docker-machine

    • docker-machine create testdocker –driver=virtualbox
    • eval “$(docker-machine env testdocker)”
    • docker-compose up -d (all containers start up properly)

      • docker-machine ip localdocker
        192.168.99.101
      • open http://192.168.99.101:8080
      • echo ${DOCKER_HOST_IP}
        192.168.99.101
      • open http://${DOCKER_HOST_IP}:8080 (// doesn’t open – times out/connection refused)
      • curl http://192.168.99.101:8080
        Connection refused

    I logged into the docker container and on ‘telnet localhost 8080’, i get connection refused error again. What am i doing wrong? I’m stumped.

  • Cython embed binary (docker): Failed to import the site module
  • How to list images in docker registry being on registry server?
  • Docker-compose networking, access host port from container
  • Create a new user in Dockerfile and fails to install npm deps
  • Where is a log file with logs from a container?
  • Docker and netstat: netstat is not showing ports, exposed by docker containers
  • One Solution collect form web for “docker-machine – connection refused error”

    Try just ping without port number. You can’t ping with port number. Check this answer.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.