Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Hm, interesting idea, didn't think of that. But what if the host IP is not always the same? For example, what if I wanted to deploy on multiple hosts and don't necessarily have a static IP I can put in my build script? 127.0.0.1 is nice because it is universal. Is there an equivilant universal way of doing this?
    – KillerKode
    Commented Nov 21, 2019 at 21:21
  • The docker0-interface also has an IP (172.17.0.1 in my case), but I don't know if it is always the same...
    – Virsacer
    Commented Nov 21, 2019 at 21:41
  • Are you talking about the host IP or docker network IP? If we are talking about the docker network IP, can I bind a port to a docker network IP so that the entire network can see it? For example -p 172.17.0.1:9000:5000 - is something like that possible? When I was testing, I couldn't get it to work for the entire network, I could only map it to one container based on exact IP.
    – KillerKode
    Commented Nov 21, 2019 at 21:44
  • docker0 is the (virtual) interface on the host - look up its IP and try with curl. But again: I dont know if it is the same adress on all hosts (it could depend on th OS and/or number of containers)
    – Virsacer
    Commented Nov 22, 2019 at 7:34
  • Reading up on it, I understand docker0 is by default a bridge connection to the host. So the IP's would change based on the host network setup.
    – KillerKode
    Commented Nov 22, 2019 at 9:15