Docker Community Forums

Share and learn in the Docker community.

Access Container via container private ip from windows host machine

Hi,
While I inspect an container I got its IP as 172.0.17.2 and its port 80 is exposed as well.
But I can’t access it from by browser neither can reachable via ping from windows command line. But I can access it via ip 10.0.75.1 which is defined by docker. Any workaround on this?

N.B: I’m using DockerForWindows on my windows 10 machine.

You have to add route from your host to containers via the next command (under elevated privilegies at your host):

route add 172.17.0.0 mask 255.255.0.0 10.0.75.2 -p

I hope it will be done via Docker itself in the future.

3 Likes

Thanks.
Got your point.

Thanky you @korsakov for the hint! I was trying the manual routing for a while, but failed on determining the correct gateway IP 10.0.75.2.

I’ll try to file a feature request for dockerwin to do this automatically.