CentOS7 docker-compose启动报错

阿里云服务器 CentOS7.2 启动docker-compose报错
系统防火墙: firewall

ERROR: for zookeeper_2181  Cannot start service zookeeper_2181: driver failed programming 
external connectivity on endpoint root_zookeeper_2181_1 (f0916868ed2751bcce48131160da82d
c2aff461b2e8892bfcd19ae61c8fd7b0c):  (iptables failed: iptables --wait -t nat -A DOCKER 
-p tcp -d 0/0 --dport 2181 -j DNAT --to-destination 172.19.0.2:2181 ! -i br-287b65ce16
2a: iptables: No chain/target/match by that name.
 (exit status 1))
ERROR: Encountered errors while bringing up the project.

解决方式
service docker restart 重启docker即可
错误原因分析:
测试发现只要在docker运行期间更改防火墙状态(打开或者关闭防火墙)都会报这个错,所以应该是和防火墙有关系
查了些资料说应该是: 原地址到目标地址转换的时候没有在docker主机的iptables规则中找到nat表规则,但是centos7都没有使用iptables了,具体什么问题还没有确定

猜你喜欢

转载自blog.csdn.net/weixin_34166472/article/details/87097002