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
sudo docker -H 10.10.10.10:1234 centos /bin/bash
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
curl http://10.10.10.10:8080
but got an error message:
curl: (7) couldn't connect to host
But I can access the server in other machines, like http://10.10.10.11:8080 It seems that docker container cannot access the service in its own host machine? Is there anyway to fix this? Thanks