1、检查Linux系统中转发是否打开:
# sudo sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
2、如果为0,说明没有开启转发,则需要手动打开:
# sudo sysctl -w net.ipv4.ip_forward=1
3、没有开启的时候,docker build会报如下错误:
WARNING: IPv4 forwarding is disabled. Networking will not work.
2016/05/20 09:15:35 Post https://discovery.hub.docker.com/v1/clusters: dial tcp: lookup discovery.hub.docker.com on 192.168.10.2:53: read udp 172.17.0.2:56087->192.168.10.2:53: i/o timeout