在Docker容器中的sqlserver的连接string

我正在使用Visual Studio 2017 for mac与dotnet核心和EF核心。 在Docker容器中设置mssql图像后,我试图添加连接string,但是引发连接错误。 我尝试了不同的选项,如IP地址,容器名称,主机名等作为服务器名称,但没有一个工作。

"Default": "Server=172.17.0.2; Database=ERPDb; User=sa; Password =******;" 

与容器名称

  "Default": "Server=ecstatic_hermann; Database=ERPDb; User=sa; Password=******;" 

主机名:

  "Default": "Server=f45840a59623; Database=ERPDb; User=sa; Password=******;" 

在通过terminal连接时使用localhost连接成功

 $ mssql -s localhost -p Technocrat123 Connecting to localhost...done sql-cli version 0.6.2 Enter ".help" for usage hints. 

但是在运行应用程序时,连接失败。

感谢任何帮助。 提前致谢。

如果使用localhost,那么错误是

 Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Integrated authentication only.