Docker容器连接到MSSQL

我是docker工人。 这是我想要做的。 Docker容器中有Web服务,我希望它访问现有的MSSQL服务器。

这里是连接string

version: '3' services: pricing.api: environment: - ASPNETCORE_ENVIRONMENT=Development - ConnectionString=data source=127.0.0.1,1433;Initial Catalog=db;Integrated Security=True; ports: - "11102:80" 

我得到这个错误

 : '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: 35 - An internal exception was caught)' 

这里有什么问题? 顺便说一句,我可以连接到本地127.0.0.1,1433。

容器内的地址127.0.0.1是指容器本身。 使用主机的另一个IP地址连接到它。