docker启动失败

启动 docker 映射到宿主机时出现如下错误时:/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint sc_mysql (1bc03030afe9f722ae1e6b46166172a70cf87bcc3f02f0acdac0be2a7f0f0036):

(iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.17.0.2:3306 ! -i docker0: iptables: No chain/target/match by that name.

[root@seichung ] pkill docker # 终止进程

[root@seichung ] iptables -t nat -F # 清空 nat 表的所有链

[root@seichung ] ifconfig docker0 down # 停止 docker 默认网桥

[root@seichung ] yum install bridge-utils -y # 部分机器是无法使用 brctl,所以需要提前安装

[root@seichung ] brctl delbr docker0 # 删除网桥

[root@seichung ] systemctl restart docker # 重启

docker docker 镜像成功映射后,会在 iptables 上添加所属的链 iptables -nL

猜你喜欢

转载自www.cnblogs.com/wangzhijiang/p/11613083.html