啟動(dòng)docker時(shí)映射到宿主機(jī)時(shí)出現(xiàn)/usr/bin/docker-current: Error response from daemon: driver failed...的解決方案

/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint sc_mysql (1bc03030afe9f722ae1e6b46166172a70cf87bcc3f02f0acdac0be2a7f0f0036): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.17.0.2:3306 ! -i docker0: iptables: No chain/target/match by that name.

[root@joker ~] pkill docker                         #終止進(jìn)程
[root@joker ~] iptables -t nat -F                    #清空nat表的所有鏈
[root@joker ~] ifconfig docker0 down                 #停止docker默認(rèn)網(wǎng)橋
[root@joker ~] yum install bridge-utils -y  # 部分機(jī)器是無法使用brctl,所以需要提前安裝
[root@joker ~] brctl delbr docker0                  #刪除網(wǎng)橋  
[root@joker ~] systemctl restart docker             #重啟docker

docker鏡像成功映射后,會在 iptables 上添加所屬的鏈

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容