Docker Community Forums

Share and learn in the Docker community.

Can't reach ports on windows machine's IP from containers

How to reach ports on windows machine from containers?

I can ping address (windows machine’s IP, which is docker’s NAT) from containers:

/app # ping                                                                                                                                                                    
PING ( 56 data bytes                                                                                                                                                
64 bytes from seq=0 ttl=127 time=0.503 ms                                                                                                                                     
64 bytes from seq=1 ttl=127 time=0.266 ms 

But can not reach opened ports for example:

/app # curl                                                                                                                                                             

Probably it is by design, but wanted to get a comment.

I think they’re available through the Gateway IP of container

May be a problem with the --network or -p parameters when you created the container. If you’re using Docker for Windows then you might also want to check out these instructions for using a more “standard” config:
In this mode you can use the docker-machine command to have more control of and visibility into your host VMs (eg. “docker-machine inspect”)

I had the same problem under Windows using Hyper-V.

I’ve solved this disabling Windows Firewall for public networks.

Similar discussion with my proposed solution.

In windows you can use .