docker启动容器时端口映射错误

docker启动容器时端口映射错误

错误如下:

[root@instance-0pk09gjj ~]# docker start a228cc3ff39e
Error response from daemon: driver failed programming external connectivity on endpoint mysql01 (2bb270948a3ce6c30a7904c6ecf66e50ec9a8871158c64c5e422c3271a94f073):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.17.0.3:3306 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1))
Error: failed to start containers: a228cc3ff39e
 

原因: 防火墙已经关闭.

解决方案:

1. 关闭防火墙, 重新重启docker服务(systemctl restart docker), 再一次启动mysql容器;

2. 对外开放3306端口, 重新重启docker服务(systemctl restart docker), 再一次启动mysql容器;

你可能感兴趣的:(docker)