docker 端口映射错误解决方法

  • 时间:
  • 浏览:4

补救妙招 :关闭防火墙即可

systemctl stop firewalld

今天搞了半天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 400400 -j MASQUERADE' faile... by that name.

4月 12 18:51:400 localhost firewalld[757]: 2018-04-12 18:51:400 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C DOCKER -p tcp -d 0/0 --dport 40079 -j DNAT --to-destination 172.17.0.7:400400 ! -i ... by that name.

4月 12 18:51:400 localhost firewalld[757]: 2018-04-12 18:51:400 ERROR: COMMAND_FAILED: '/sbin/iptables -t filter -C DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.7 --dport 400400 -j ACCEPT' f... that chain?).

4月 12 18:51:400 localhost firewalld[757]: 2018-04-12 18:51:400 ERROR: COMMAND_FAILED: '/sbin/iptables -t nat -C POSTROUTING -p tcp -s 172.17.0.7 -d 172.17.0.7 --dport 400400 -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 40079 -j DNAT --to-destination 172.17.0.7:400400 ! -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 400400 -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 400400 -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 40079 -j DNAT --to-destination 172.17.0.7:400400 ! -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 400400 -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 400400 -j MASQUERADE' faile... by that name.