错误:
# docker run -d -p 99:9999 training/webapp python app.py
1325dce379ac8b1c0c8bee610496493aaeaf5f07bd66b570d825dfa654ea265c
/usr/bin/docker-current: Error response from daemon: driver failed programming external
connectivity on endpoint affectionate_jones (d7f626f6db732089550b3724705f91fdb5545d34917d3d62bc1745093a4d48a0):
(iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 99 -j DNAT --to-
destination 172.18.0.3:9999 ! -i docker0: iptables: No chain/target/match by that name.
错误原因:
解决方法:
pkill docker 终止进程
iptables -t nat -F 清空nat表的所有链
ifconfig docker0 down#停止docker默认网桥
docker -d (后台运行docker)
systmctl restart docker(重启docker)
重新执行:成功!
#docker run -d -p 80:9999 training/webapp python app.py
4daea226e5ac47694924c3a5734b37407e23b61de0206d7c9cfa6db2768c146b
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4daea226e5ac training/webapp "python app.py" 7 minutes ago Up 7 minutes 5000/tcp, 0.0.0.0:80->9999/tcp vibrant_keller
网友评论