1. 程式人生 > >[Docker] docker run -p shows iptables fail on CentOS 7

[Docker] docker run -p shows iptables fail on CentOS 7

I was playing around with Sentry, and when I tried to run it with

docker run \
  --detach \
  --link sentry-redis:redis \
  --link sentry-postgres:postgres \
  --env SENTRY_SECRET_KEY=123456 \
  --name sentry-web-01 \
  --publish 9000:9000 \
  sentry-onpremise \
  run web

I got an error

Cannot start container <
container id>: iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.23 --dport 4000 -J ACCEPT: iptables: No chain/target/match by that name.

The solution:
Make sure you have firewalld started and runing.
If firewalld is stopped, you will only get the default INPUT, OUTPUT, FORWARD

chain