Deffiss / testenvironment-docker

MIT License
117 stars 30 forks source link

Generated connection string for SQL Server not working #39

Closed mogatti closed 4 years ago

mogatti commented 4 years ago

Hi,

I tried to use your library and for running mssql containers, using localhost as the Data Source for the connection string does not always work. When I change this to 127.0.0.1 it works.

This fix for people who cannot get localhost working is also mentioned here https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-troubleshooting-guide

Deffiss commented 4 years ago

Hi @mogatti, Thanks for reporting that interesting issue. I'll try to reproduce it. We might probably need to change localhost to 127.0.0.1 by default. @Hellevar any opinion?

mogatti commented 4 years ago

No problem :) I should add this is using Docker Desktop for Windows and running without docker inside docker. I'm not sure exactly why localhost has not worked for me in the past which does not help.

Hellevar commented 4 years ago

I didn't experience such issues before

mogatti commented 4 years ago

Curious to know what do you get if you try "docker port " on your Linux SQL container?

I'm getting 1433/tcp -> 0.0.0.0:1433