1

I'm using following system:

[alexus@wcmisdlin02 Desktop]$ rpm -q docker
docker-1.9.1-25.el7.centos.x86_64
[alexus@wcmisdlin02 Desktop]$ cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
[alexus@wcmisdlin02 Desktop]$ uname -a
Linux wcmisdlin02.uftmasterad.org 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[alexus@wcmisdlin02 Desktop]$ 

I'm referring to Compose File Reference for syntax of docker-compose.yml:

[alexus@wcmisdlin02 Desktop]$ cat docker-compose.yml 
nginx:
  container_name: nginx
  image: nginx
  ports:
    - "80:80"
[alexus@wcmisdlin02 Desktop]$ docker-compose up
Creating nginx

ERROR: for nginx  Cannot start container fcaba40fb21cc64f514d71eb8117ba0f2102482be6e74615e96261667403a236: failed to create endpoint nginx on network bridge: COMMAND_FAILED: '/sbin/iptables -w2 -t nat -A DOCKER -p tcp -d 0/0 --dport 80 -j DNAT --to-destination 172.17.0.2:80 ! -i docker0' failed: iptables: No chain/target/match by that name.
Attaching to 
[alexus@wcmisdlin02 Desktop]$

If I to remove ports part out of docker-compose.yml, container starts, but obviously network is not set the way I need it too.

I need nginx container to start to listen on port 80 on host.

What am I doing wrong?

alexus
  • 12,342
  • 27
  • 115
  • 173

2 Answers2

2

iptables: No chain/target/match by that name.

Something on your system removed Docker's iptables rules. They can be recreated by restarting the Docker service.

BMitch
  • 5,189
  • 1
  • 21
  • 30
  • I rebooted my system and that did not do anything for me( – alexus Jul 27 '16 at 15:22
  • A full reboot may also restart whatever is removing the firewall rules. Try only restarting the Docker service. – BMitch Jul 27 '16 at 18:56
  • I tried before, even full reboot wouldn't help... but after updating to later version problem was resolved, maybe there was a bug? – alexus Jul 27 '16 at 18:58
0

I'm guessing there was a bug, as I tried it again and now it's working. I did update docker package to latest version:

[alexus@wcmisdlin02 ~]$ rpm -q docker
docker-1.10.3-44.el7.centos.x86_64
[alexus@wcmisdlin02 ~]$ 
alexus
  • 12,342
  • 27
  • 115
  • 173