Accessing Host Network from Docker Container

On a Linux system, the command below will print out the ip address your device has on the network docker sets up between containers and host system. The only thing that needs to be wary of host services can't serve to localhost or 127.0.0.1 they must serve to 0.0.0.0.

ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+'
172.17.0.1
curl 172.17.0.1
Hello World!

71 words

2021-03-16