Docker For Mac - On prem DB IP conflicts with local Docker Container

Hi,

I have searched the web high and low but cannot find a solution so hope someone can help a Docker newbie!

I have installed Docker for Mac and have successfully launched an Ubuntu container that has an IP gateway and address of…

Gateway 172.17.0.1
IPAddress 172.17.0.3

I can connect to the container without any issue but when I try to connect to an on prem MSSQL database from the container I get Destination Host Unreachable. The on prem DB (172.17.60.*) is on the same network as the container but I’m not sure how to resolve this problem.

Any advice would be greatly appreciated.

Many thanks,

Nathan

Did you deploy the Database container with a -p 3306:3306 or something like that?
if not the host will assume that port is on the host itself not the container

The other possibility I see is that you have deployed the Container network as the same IP space as the external network this will have the container trying to reach the IP on the internal network, not the external network.

Thanks Don, I think you’re right with the second comment but I’m not sure how to change the IP address of my container on Docker for Mac. This doc has confused me a bit more! https://docs.docker.com/docker-for-mac/networking/ There appears to be no Docker bridge

I’ve finally sorted this. I just added…
{
“bip”: “10.10.0.1/16"
}
To the daemon advanced settings and life is good! Thanks Don for putting me on the right track

AWesome! glad I could help :slight_smile:

Have fun!

Don