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?