iptables failed: iptables --wait -t nat -A DOCKER
今天tomcat的docker容器掛了,只要是帶命令-p映射端口就起不來并且報錯:
Error?response?from?daemon:?Cannot?start?container?eb9d501f56bc142d9bf75ddfc7ad88383b7388ca6a5959309af2165f1fff6292:?iptables?failed:?iptables?--wait?-t?nat?-A?DOCKER?-p?tcp?-d?0/0?--dport?8081?-j?DNAT?--to-destination?
172.17.0.164:8080?!?-i?docker0:?iptables:?No?chain/target/match?by?that?name.
?(exit?status?1)
?
網(wǎng)上查找發(fā)現(xiàn),可能是網(wǎng)絡(luò)問題造成
首先先驗(yàn)證docker容器內(nèi)部網(wǎng)絡(luò)是否能ping通宿主機(jī)
如果能ping通,即可通過重建docker0網(wǎng)絡(luò)恢復(fù)
先停掉宿主機(jī)上運(yùn)行的docker容器,然后執(zhí)行以下命令
在宿主機(jī)執(zhí)行:
問題即可解決。。
?
備注iptables的配置文件路徑? ?vim /etc/sysconfig/iptables
iptables命令:
systemctl start iptables #啟動
systemctl status iptables #查看運(yùn)行狀態(tài)
systemctl restart iptables.service #重啟
systemctl stop iptables.service #停止
systemctl enable iptables.service #設(shè)置開機(jī)啟動
systemctl disable iptables.service #禁止開機(jī)啟動
?
總結(jié)
以上是生活随笔為你收集整理的iptables failed: iptables --wait -t nat -A DOCKER的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android如何将软键盘回车换成搜索等
- 下一篇: OllyDbg设置