docker遇到防火牆報錯問題解決方法

-- 報錯信息
[root@localhost docker]# docker run -d -p 5000:5000 training/webapp python app.py
cc61442060cb810633a06bd6ea692a3df6b0bfcadc6a7dadfe53bf875f1ac3b9
docker: Error response from daemon: driver failed programming external connectivity on endpoint pensive_hodgkin (ae7e41e1b2b98b6b482316085c22303d8a61c02d09eb21c241132da1ea34d58a): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 5000 -j DNAT --to-destination 172.17.0.3:5000 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).python

解決方法:
1.kill掉docker全部進程web

pkill docker

2.清空nat表的全部鏈docker

iptables -t nat -F

3.中止docker默認網橋docker0app

ifconfig docker0 down

4.刪除docker0網橋webapp

brctl delbr docker0

5.重啓docker服務tcp

systemctl restart docker

從新啓動docker容器spa

docker run -d -p 5000:5000 training/webapp python app.py
相關文章
相關標籤/搜索