Orchestration:
bridge
) network.At first I just left the connection string as .,1444
but realized that the container would have to look up outside of itself to get the host localhost it needed.
So far I've tried:
127.0.0.1:1444
host.docker.internal:1444
127.0.0.1,1444
host.docker.internal,1444
.,1444
I keep getting this error:
Connection id "0HLV8EI9HSV9D", Request id "0HLV8EI9HSV9D:00000009": An unhandled exception was thrown by the application.
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)```
The most common way to do this is to add --network="host"
in your docker run command, then 127.0.0.1 in your docker container will point to your docker host.
If this is not suitable for you, this question contains a bunch of hacky ways to achieve the same thing.
Such as:
I believe that link will help you come to a solution that is most suitable for you.
User contributions licensed under CC BY-SA 3.0