Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container does not start when ports beeing forwarded #72

Closed
mathse opened this issue May 23, 2015 · 8 comments
Closed

container does not start when ports beeing forwarded #72

mathse opened this issue May 23, 2015 · 8 comments

Comments

@mathse
Copy link

mathse commented May 23, 2015

docker run -e MYSQL_ROOT_PASSWORD=password -p 33066:3306 mysql

Error response from daemon: Cannot start container d21750c5bd3a5c1f873a4be97c49f2897fbcc20c9c4344075bd2e2e2d32e8b50: (exit status 1)

docker-compose also is not able to start the container

cat docker-compose.yml
db:
image: mysql
ports:

  • "33066:3306"
    environment:
  • MYSQL_PASSWORD=password

is this behavior intended?

@thaJeztah
Copy link

Sounds like the port could already be in use on that machine. Perhaps another mysql container, or a non-containerised mysql server running directly on the machine?

@mathse
Copy link
Author

mathse commented May 23, 2015

nope - thats not the case

trying to forward any port fails to start the container

@thaJeztah
Copy link

Was worth a try. You could try and check the daemon logs to see if that contains anything useful

@mathse
Copy link
Author

mathse commented May 23, 2015

May 23 23:46:08 rhea docker: [46775291.allocate_port(c2c75d63f224cf22be2fe9d0eed8410c587630ac7c591d4bd3bee664a6c185bc)] Failed to allocate and map port 33066: iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 33066 ! -i docker0 -j DNAT --to-destination 172.17.0.143:3306: iptables: No chain/target/match by that name.
May 23 23:46:08 rhea docker: (exit status 1)
May 23 23:46:08 rhea docker: iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 33066 ! -i docker0 -j DNAT --to-destination 172.17.0.143:3306: iptables: No chain/target/match by that name.
May 23 23:46:08 rhea docker: (exit status 1)

am I doing something wrong or my centos 7?

@thaJeztah
Copy link

two things that sound dodgy (but I'm not really good at the iptables rules here)

  • I see port 33066 in those logs (two 6's)?
  • it looks like the DOCKER chain is missing in the iptables rules

you might try and search for "missing DOCKER chain", I think I've seen something like that before reported in Docker and how to solve that

@mathse
Copy link
Author

mathse commented May 23, 2015

yep I want to forward port 33066 to the containerd 3306

@mathse
Copy link
Author

mathse commented May 24, 2015

did some debugging
Ubuntu 15.04 = working
CentOS 6.6 = working
CentOS 7 = not working

all tested with docker 1.6.2

@mathse
Copy link
Author

mathse commented May 24, 2015

Solution: restarting firewalld is the problem an is removing the docker chain - restarting the docker service solves the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants