I am running a mariadb
instance in a docker container. It is connected to a custom bridge network. Let's call it db_net
here.
Now I want to connect to mariadb
from another container connected to the same network.
I can ping the mariadb
container from the other container with ping mariadb.db_net
. It resolves to some 172.x.x.x
IP.
Setting up the grant table in mariadb
with numeric IPs works. But obviously these may change in a modified setup. I also would like to avoid using all wildcards (e.g 172.%.%.%
) since other containers may also use the same mariadb
instance.
Using the symbolic host name (name.db_net
) in the grants table fails.
What is the recommended way to solve this? Using all wildcards in the host field and relying on other isolation mechanisms of course works, but it seems like doing that I give up a layer of security that would be desirable.