记一次docker启动容器错误
docker启动容器时报错:
[root@localhost ~]# docker start mysql-test
Error response from daemon: driver failed programming external connectivity on endpoint mysql-test (23488b00e76955c9342894e0b3899937709ef42f711b6aef9063603ac9baf5f6): (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.
(exit status 1))
Error: failed to start containers: mysql-test
原因
docker服务启动时定义的自定义链DOCKER由于某种原因被清掉,重启docker服务可重新生成自定义链DOCKER
解决
重启docker服务,删除刚才运行报错运行成功的容器,再重新运行镜像
[root@localhost ~]# systemctl restart docker
tl restart docker