当咱们中止防火墙后,docker容器启动映射端口可能没法映射端口,这个时候须要重建docker0网桥。docker
详细的错误是这样的:app
docker: Error response from daemon: driver failed programming external connectivity on endpoint xid (0fb1bc901c3d3d4db71785fdf6b351ef226ee3daf717c284263717ee89674860): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 7077 -j DNAT --to-destination 172.17.0.3:7077 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).tcp
因此咱们须要重建docker0网桥:spa
pkill docker iptables-t nat -F ifconfig docker0 down brctl delbr docker0 docker-d service docker restart
而后从新构建就能够发现能够构建了。问题完美解决。.net
借鉴这位大兄弟的:https://blog.csdn.net/happyzwh/article/details/875363363d