Docker container cannot connect to host machine: No route to host

I’ve been trying to setup a docker environment using docker compose. One issue that has me stumped is that my docker containers cannot reach my host machine.

I setup a container using the following compose file:

  • Get version of the docker base image used to build an image
  • A jenkins-slave container image per module type or a single centralized one which can build anything?
  • my coreos/fleet deployed service is dying and I can't tell why
  • tools for defining and running complex applications with docker
  • COPY of existing file in Dockerfile fails mysteriously
  • Docker container disk size in mesos and marathon
  • version: '3'
    services:
      webapp:
        image: ...
        ports:
          - "8080:8080"
    

    When I enter the container, I am able to ping my host machine:

    ping ${dockerHostIP}
    

    However when I try and retrieve the home page using curl inside the container:

    curl http://${dockerHostIP}:8080
    

    I get:

    curl: (7) Failed connect to ${dockerHostIP}:8080; No route to host
    

    I cannot figure out what should be done to resolve this No route to host error. Unfortunately I need to be able to do this as the web application makes requests using its hostname internally.

    Traceroute Results:

    traceroute ${dockerHostIP}
    traceroute to ${dockerHostIP} (${dockerHostIP}), 30 hops max, 60 byte packets
     1  ${dockerHostName} (${dockerHostIP})  0.039 ms !X  0.012 ms !X  0.007 ms !X
    

  • How to I output results of shell script in a makefile?
  • How much memory needed for build docker v1.9.0
  • Docker: Best way to handle security updates of packages from apt-get inside docker containers
  • Multiple aerospike nodes on docker
  • Issues getting Ansible to work with Boot2Docker
  • Running collectstatic on Dokku doesn't copy files
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.