docker 端口映射错误解决方法

论坛 期权论坛 脚本     
匿名技术用户   2021-1-8 10:47   66   0

docker 端口映射错误解决方法

今天搞了半天shipyard,在网页上打开时无法显示容器和镜像,最后发现是docker端口映射错误,由于防火墙未关闭:

4月 12 18:51:29 localhost firewalld[757]: 2018-04-12 18:51:29 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C POSTROUTING -p tcp -s 172.17.0.7 -d 172.17.0.7 --dport 8080 -j MASQUERADE' faile... by that name.
4月 12 18:51:30 localhost firewalld[757]: 2018-04-12 18:51:30 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C DOCKER -p tcp -d 0/0 --dport 8079 -j DNAT --to-destination 172.17.0.7:8080 ! -i ... by that name.
4月 12 18:51:30 localhost firewalld[757]: 2018-04-12 18:51:30 ERROR: COMMAND_FAILED: '/sbin/iptables -t filter -C DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.7 --dport 8080 -j ACCEPT' f... that chain?).
4月 12 18:51:30 localhost firewalld[757]: 2018-04-12 18:51:30 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C POSTROUTING -p tcp -s 172.17.0.7 -d 172.17.0.7 --dport 8080 -j MASQUERADE' faile... by that name.
4月 12 18:51:31 localhost firewalld[757]: 2018-04-12 18:51:31 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C DOCKER -p tcp -d 0/0 --dport 8079 -j DNAT --to-destination 172.17.0.7:8080 ! -i ... by that name.
4月 12 18:51:31 localhost firewalld[757]: 2018-04-12 18:51:31 ERROR: COMMAND_FAILED: '/sbin/iptables -t filter -C DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.7 --dport 8080 -j ACCEPT' f... that chain?).
4月 12 18:51:31 localhost firewalld[757]: 2018-04-12 18:51:31 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C POSTROUTING -p tcp -s 172.17.0.7 -d 172.17.0.7 --dport 8080 -j MASQUERADE' faile... by that name.
4月 12 18:51:32 localhost firewalld[757]: 2018-04-12 18:51:32 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C DOCKER -p tcp -d 0/0 --dport 8079 -j DNAT --to-destination 172.17.0.7:8080 ! -i ... by that name.
4月 12 18:51:32 localhost firewalld[757]: 2018-04-12 18:51:32 ERROR: COMMAND_FAILED: '/sbin/iptables -t filter -C DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.7 --dport 8080 -j ACCEPT' f... that chain?).
4月 12 18:51:32 localhost firewalld[757]: 2018-04-12 18:51:32 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C POSTROUTING -p tcp -s 172.17.0.7 -d 172.17.0.7 --dport 8080 -j MASQUERADE' faile... by that name.

解决方法:关闭防火墙即可

systemctl stop firewalld

posted @ 2018-04-12 19:01 予你心安 阅读( ...) 评论( ...) 编辑 收藏
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP