Issue Type
- Can’t connect to the Python app created in Containerize an application | Docker Docs on http://localhost:4000
OS Version/build
- Windows 10 Home German, Build 15063.483
- 32 GB RAM
- quad core CPU (with H/T)
App Version
- Docker Toolbox for Windows
- Docker 17.06.0-ce
- VirtualBox 5.1.26
Steps to recreate
- Running the app with
docker run -p 4000:80 friendlyhello
- Can’t view its web server at localhost:4000
My Analysis
- Here’s the network part of the container description
"NetworkSettings": { "Bridge": "", "SandboxID": "176d7bc3e5c5328048333cace9f9f67715c6ac08b5055ed0b5ba19671696aa8b", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "4000" } ] }, "SandboxKey": "/var/run/docker/netns/176d7bc3e5c5", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "8cf0907a180a00ce89339f1bdef26278c0c45e1992b1c97d7bf5127cbc929da6", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "MacAddress": "02:42:ac:11:00:02", "Networks": { "bridge": { "IPAMConfig": null, "Links": null, "Aliases": null, "NetworkID": "f1fe24f3d616f4e06c93ad868b3eebb9043e19cacf9c13043d2af9ee5008f322", "EndpointID": "8cf0907a180a00ce89339f1bdef26278c0c45e1992b1c97d7bf5127cbc929da6", "Gateway": "172.17.0.1", "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "02:42:ac:11:00:02", "DriverOpts": null } } }
- Here’s my VirtualBox network configuration
Ethernet-Adapter VirtualBox Host-Only Network:
Verbindungsspezifisches DNS-Suffix:
Verbindungslokale IPv6-Adresse . : fe80::c850:7f06:c8dd:eaf4%6
IPv4-Adresse . . . . . . . . . . : 192.168.56.1
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . :Ethernet-Adapter VirtualBox Host-Only Network #2:
Verbindungsspezifisches DNS-Suffix:
Verbindungslokale IPv6-Adresse . : fe80::3991:2956:e235:1591%14
IPv4-Adresse . . . . . . . . . . : 192.168.99.1
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . :
- Is this because of a mismatch between my VirtualBox network addresses at 192.168.x.x and the container one at 172.17.0.x?
My attempted solutions
- Disabled Windows firewall for home network and in general to (I don’t run separate anti-virus or security product, apart from built-in Windows Defender)
- Tried these IP addresses: 192.168.56.1:4000, 192.168.99.1:4000, 127.0.0.1:4000
- Tried to create my own network for the container