docker 端口映射错误解决方法

  • 时间:
  • 浏览:2

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

外理最好的依据 :关闭防火墙即可

systemctl stop firewalld

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 3030 -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 3079 -j DNAT --to-destination 172.17.0.7:3030 ! -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 3030 -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 3030 -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 3079 -j DNAT --to-destination 172.17.0.7:3030 ! -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 3030 -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 3030 -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 3079 -j DNAT --to-destination 172.17.0.7:3030 ! -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 3030 -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 3030 -j MASQUERADE' faile... by that name.