Docker can't reach the outside net

Running a command similar to this one results in apt-get just hanging and finally timing out.

docker run -it --rm debian:stable "apt-get update"  

On a typical install run

docker network inspect bridge  

What you are looking for is

"Config": [
    {
        "Subnet": "172.17.0.0/16",
        "Gateway": "172.17.0.1"
    }
]

and

"Options": {
    "com.docker.network.bridge.default_bridge": "true",
    "com.docker.network.bridge.enable_icc": "true",
    "com.docker.network.bridge.enable_ip_masquerade": "true",
    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
    "com.docker.network.bridge.name": "docker0",
    "com.docker.network.driver.mtu": "1500"
},

If you run

ip route list  

and you don't see 172.17.0.0/16 in there or docker0 that is your problem.

sudo ip route add 172.17.0.0/16 dev docker0  

will likely fix this problem.