title: How to connect to service in the host machine from inside a docker container?
body: <p>I have a docker daemon started in the host machine listen to some ip address and port, say 10.10.10.10, and port 1234, then I start a container by invoking</p>
  
  <pre><code>sudo docker -H 10.10.10.10:1234 centos /bin/bash
  </code></pre>
  
  <p>Meanwhile, I have a web service runnig on the host machine, running on the port 8080. Then from inside the container, I cannot connect to this server. I tried</p>
  
  <pre><code>curl http://10.10.10.10:8080
  </code></pre>
  
  <p>but got an error message:</p>
  
  <pre><code>curl: (7) couldn't connect to host
  </code></pre>
  
  <p>But I can access the server in other machines, like <a href="http://10.10.10.11:8080">http://10.10.10.11:8080</a>
  It seems that docker container cannot access the service in its own host machine? Is there anyway to fix this? Thanks</p>