How to access SQL Server in host from docker container

19 Views Asked by At

What I have

  • default instance of SQL Server running or my Windows 11 laptop. I connect to it using Server=localhost or Server=MyComputerName

  • web backend running in a windows container.

Question

How do I connect from the container to the host's sql server?

Ideal solution (powershell/dockercompose) would work on other PCs with the same setup except ComputerName.

0

There are 0 best solutions below