open iptables whithin docker-compose network and one external server

by kaki gadol   Last Updated August 14, 2019 15:01 PM

Im Trying to deploy a system using docker compose which contains mysql server. The server is shared between the docker containers in the same network.

I need to access the mysql db from a specific external server in our network, so i published the mysql port (3306) within the docker compose file.

But as a security concern I wan to block any other ip who tries to access this port.

I tried many iptables rules and all of them either blocked containers within the docker-compose or allowed other servers to access the port.

p.s. I will all change the user permissions within the mysql server, but blocking the port is the first thing we want to do.

Related Questions

IPTABLES - How dose the Docker port a:b work?

Updated November 21, 2017 14:01 PM