I have a running nginx container: # docker run --name mynginx1 -P -d nginx
;
And got its PORT info by docker ps
: 0.0.0.0:32769->80/tcp, 0.0.0.0:32768->443/tcp
Then I could get response from within the container(id: c30991a04b2f):
docker exec -i -t c3099 bash
curl http://localhost
=> which return the defaultindex.html
page content, it works
However, when I make the curl http://localhost:32769
outside of the container, I got this:
curl: (7) failed to connect to localhost port 32769: Connection refused
I am running on a mac with docker version 1.9.0; nginx latest
Does anyone know what cause this? Any help? thank you