欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Docker报错 WARNING: IPv4 forwarding is disabled. Networking will not work.

程序员文章站 2022-03-12 16:56:15
...

问题

[[email protected] ~]# docker run -d --name nginx-volume-test1 -v /data nginx

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

解决办法

[[email protected] ~]# echo "net.ipv4.ip_forward=1" >> /usr/lib/sysctl.d/00-system.conf

重启网络

[[email protected] ~]# systemctl restart network

删除容器,再创建

[[email protected] ~]# docker run -d --name nginx-volume-test1 -v /data nginx

50541bd1e32262485a87f34f259cab581641ce6798a525a1655b5edb348330f8