Should docker run --net=host work?

You’re on a Mac, so, remember that your docker daemon is actually running in a virtual machine, not your actual machine. Thus, it’s not connecting to host ports for your Mac, but rather it’s connecting to host ports for that specific virtual machine.

You can get the IP of the machine it is connecting to the ports of with echo $DOCKER_HOST

2 Likes