[root@localhost ~]# docker build -t test1 .

...省略...

WARNING: IPv4 forwarding is disabled. Networking will not work.  

error:xxxxxxx

...


解决办法:

在宿主机上面执行:

# net.ipv4.ip_forward=1 >> /usr/lib/sysctl.d/00-system.conf

重启network和docker服务

# systemctl restart network && systemctl restart docker


成功解决!!