初次接触docker,在启动docker的时候提示警告 WARNING: IPv4 forwarding is disabled. Networking will not work.

[root@localhost mytomcat]# docker run --name eduweb  -dp 8801:8080 edu
WARNING: IPv4 forwarding is disabled. Networking will not work.

经过网上一番冲浪,解决方案如下:

修改配置文件:

vim /usr/lib/sysctl.d/00-system.conf

追加

 net.ipv4.ip_forward=1

接着重启网络

[root@localhost mytomcat]# systemctl restart network

然后将之前错误的docker删掉,重新创建启动即可

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐