问题:

[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

 

相关文章:

  • 2021-11-13
  • 2021-11-28
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2022-02-19
  • 2022-03-05
  • 2021-11-24
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-07-23
相关资源
相似解决方案