新聞中心
容器中使用iptables報(bào)錯(cuò)can't initialize iptables table Permission denied該怎么解決,針對(duì)這個(gè)問(wèn)題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問(wèn)題的小伙伴找到更簡(jiǎn)單易行的方法。
夏津ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書(shū)銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書(shū)合作)期待與您的合作!
背景
在docker容器中部署了一微服務(wù),該服務(wù)需要docker push鏡像到docker registry。因此,docker容器中需要安裝docker服務(wù)。但在啟動(dòng)容器的時(shí)候,卻報(bào)錯(cuò):
can't initialize iptables table `filter': Permission denied (you must be root) Perhaps iptables or your kernel needs to be upgraded.
原因
在容器中部署docker服務(wù),而docker服務(wù)又會(huì)使用到iptables,因此在啟動(dòng)容器時(shí),也會(huì)同時(shí)啟動(dòng)容器內(nèi)的iptables。但iptables必須工作在容器的privileged模式下,否則就會(huì)如上報(bào)錯(cuò)。
解決方法
在啟動(dòng)容器時(shí)加上對(duì)應(yīng)的privileged參數(shù)。
docker中啟動(dòng)容器
docker run -privileged [imageName]
Marathon中啟動(dòng)容器
{ ... "instances": 1, "container": { "type": "DOCKER", "volumes": [], "docker": { "image": "imageName", "network": "BRIDGE", "privileged": true, "parameters": [], } } ... }
關(guān)于容器中使用iptables報(bào)錯(cuò)can't initialize iptables table Permission denied該怎么解決問(wèn)題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒(méi)有解開(kāi),可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識(shí)。
分享文章:容器中使用iptables報(bào)錯(cuò)can'tinitializeiptablestablePermissiondenied該怎么解決
轉(zhuǎn)載注明:http://fisionsoft.com.cn/article/gisose.html