3 ms·
> and '0.0.0.0' means "accessible only on the local machine" I don't think that right? It just means "is available to be mapped out of the container", but you
by yjftsjthsd-h 2y ago
> and '0.0.0.0' means "accessible only on the local machine"
I don't think that right? It just means "is available to be mapped out of the container", but you still have to use -p or such for it to do anything
- TheDong 2y agoYou don't have to use -p with docker's default settings. $ docker run --rm --name listen busybox sh -c 'echo hi | nc -l -p 8000' # in another terminal $ docker inspect listen -f '{{ .NetworkSettings.IPAddress }}' 172.17.0.3 $ nc 172.17.0.3 8000 < /dev/null hi Works just fine for accessing it on your local machine. The -p flag is meant to "publish" a port so it's available remotely, from outside of your machine (i.e. to serve nginx to the public internet on a webserver with '-p 80:80' or whatever).