问题:
[[email protected] ~]$sudo docker run -d --name nginx -p 80:8080 nginx WARNING: IPv4 forwarding is disabled. Networking will not work.
解决方法:
[[email protected] ~]$ sudo vim /usr/lib/sysctl.d/00-system.conf
#添加如下代码: net.ipv4.ip_forward=1
重启network和docker服务
[[email protected] ~]$ sudo systemctl restart network
[[email protected] ~]$ sudo systemctl restart docker
原文地址:https://www.cnblogs.com/yyxianren/p/10752772.html
时间: 2024-11-07 09:57:02