docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name
docker 報(bào)錯(cuò):
Error response from daemon: Cannot restart container hello: driver failed programming external connectivity on endpoint hello (e58d18c830689e296c0fafdd98bf56e973cee3a3fbee8a3f002d46784f69ae70): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 6081 -j DNAT --to-destination 172.0.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))
翻譯:無法重新啟動(dòng)容器hello:驅(qū)動(dòng)程序未能在端點(diǎn)hello上編程外部連接:(iptables失敗:iptables–wait–t nat–A DOCKER–p tcp–d 0/0–dport 6081–j DNAT–to destination 172.18.0.2:8080!-i docker0:iptables:沒有該名稱的鏈/目標(biāo)/匹配。
錯(cuò)誤原因:
docker 服務(wù)啟動(dòng)的時(shí)候,docker服務(wù)會(huì)向iptables注冊(cè)一個(gè)鏈,以便讓docker服務(wù)管理的containner所暴露的端口之間進(jìn)行通信。
如果你刪除了iptables中的docker鏈,或者iptables的規(guī)則被丟失了(例如重啟firewalld),原有的docker端口映射不存在了。
可以通過命令iptables -L可以查看iptables鏈,如果是空的或者上面報(bào)錯(cuò)的映射端口不存在,那你的問題應(yīng)該是這個(gè)原因了。
解決方法:
命令:
sudo systemctl restart docker
然后將每個(gè)容器重啟即可,無需刪除容器,無需重裝docker。
總結(jié)
以上是生活随笔為你收集整理的docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数据库中自定义排序规则,Mysql中自定
- 下一篇: 系统架构升级要不要上微服务?历“久”弥新