問題:
[yuyongxr@localhost ~]$sudo docker run -d --name nginx -p 80:8080 nginx
WARNING: IPv4 forwarding is disabled. Networking will not work.
解決方法:
[yuyongxr@localhost ~]$ sudo vim /usr/lib/sysctl.d/00-system.conf
#添加如下代碼: net.ipv4.ip_forward=1
重啟network和docker服務
[yuyongxr@localhost ~]$ sudo systemctl restart network
[yuyongxr@localhost ~]$ sudo systemctl restart docker