I have a separate sql server docker running as a independent source from my host project. I want to keep things fairly independent as possible and sharing db instance across project simplifies my setup. Biggest headache – how to access the sql instance from the container.

Docker compose:

Solution came from this : https://forums.docker.com/t/how-to-access-the-host-machine-in-docker-compose/134949

For windows – just look in your hosts file and see what ip address of host.docker.internal is set to. Use this as the address to the service you need and it will work. From my requirement it meant setting the address for the sql server to 192.168.7.243. I will create a simple project explaining later.

For kubernetes its much simplier, setup a service with type exernal name and it will correctly connect you to your required service.

Now I use Kubernetes when connected online but for airplane mode – Kubernetes doesnt work, needs an active network setup – hence now I setup for both kubernetes – which is closer to what will be deployed to staging and live, and a docker compose setup for airplane mode development.