在centos7 中docker info报错docker bridge-nf-call-iptables is disabled 的解决方法
程序员文章站
2023-11-19 15:43:40
在centos7中安装好docker以后,启动成功,运行命令 docker info ,报错:
[root@iz2ze2bn5x2wqxdeq65wlpz ~]# docker info
Client:
Debug Mode: false
Server:
Containers: 4
Ru... ......
在centos7中安装好docker以后,启动成功,运行命令 docker info ,报错:
[root@iz2ze2bn5x2wqxdeq65wlpz ~]# docker info client: debug mode: false server: containers: 4 running: 0 paused: 0 stopped: 4 images: 2 server version: 19.03.1 ....................... warning: bridge-nf-call-iptables is disabled warning: bridge-nf-call-ip6tables is disabled
解决办法:
vim /etc/sysctl.conf
在文件尾部添加以下三行内容:
net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 net.bridge.bridge-nf-call-arptables = 1
然后,再执行命令:
sysctl -p
或者:
sysctl -p 2>/dev/null| grep bridge
现在,我们再执行命令:docker info,就看不到报错了。