"Get started" course: Can't connect to web server on Windows 10

Issue Type


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

Solved it myself. As it turned out, it was a Windows 10 Edge browser problem. The container port does get exposed at the Docker IP address, shown by

docker-machine ip Default

However, Edge doesn’t show its content.- only Chrome showed it at http://192.168.99.100:4000 without any more meddling.

2 Likes

Thanks for sharing this.

In my case I could reach the app in the container via http://192.168.99.100:4000/, not localhost:4000 as shown in the tutorial.

Seems the getting started manual is somewhat unclear, so that the app running in the container can be accessed via the ip address shown in docker-machine ip Default (and the port), not via localhost.

I had been trying to access it from the running container’s IP address, and localhost and stuff . In the end going to http://192.168.99.100:xxxx fixed it for me too.

It’d be nice to mention this in the tutorial, as though it’s apparently a known issue I used up a lot of my afternoon trying to work out what was going on until I found this post!

Thanks! You rescued my day. :smiley: