问题:COMMAND_FAILED: '/sbin/iptables -t nat -A Docker -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.17.0.6:3306 ! -i mysql_default' failed: iptables: No chain/target/match by that name.
处理:
- 查看容器已使用的network信息
docker network ls |grep mysql
如图
image.png
- 删除掉已停止容器对应的network信息
docker network rm mysql_default
or
- 使用清理命令 ,不被docker使用的network都将被清理掉
docker network prune
再启动mysql容器时一切正常。
附带: docker network 完整使用
[root@localhost logs]# docker network --help
Usage: docker network COMMAND
Manage networks
Options:
--help Print usage
Commands:
connect Connect a container to a network
create Create a network
disconnect Disconnect a container from a network
inspect Display detailed information on one or more networks
ls List networks
prune Remove all unused networks
rm Remove one or more networks
Run 'docker network COMMAND --help' for more information on a command.
网友评论