在 Amazon Linux multidocker 容器上的 Docker 中运行的 DotnetCore 应用程序在 Sql Server 登录过程中返回错误

App*_*nOz 5 linux sql-server amazon-web-services .net-core

我在 Amazon Linux 实例(64 位 Amazon Linux 2016.09 v2.5.2 running Multi-container Docker 1.12.6 (Generic))内的 Docker 上运行了一个 DotnetCore 应用程序 ( DotNetCore v1.1 )。

当我尝试连接到我的Sql Server 2014 (Cumulative Update 2) 时,出现异常

Exception:   System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 35 - An internal exception was caught) ---> System.IO.IOException: Unable to write data to the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Data.SqlClient.SNI.SslOverTdsStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslStreamInternal.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStreamInternal.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Data.SqlClient.SNI.SNITCPHandle.Send(SNIPacket packet)
--- End of inner exception stack trace ---
Run Code Online (Sandbox Code Playgroud)

我尝试过的事情

  1. 可以从 AWS Elastic Beanstalk 应用程序中运行的 docker 容器访问端口 1433,并且可以建立到服务器的连接。
  2. 在 Mac 上运行时,包含应用程序的 Docker 容器可以连接到同一个 SQL Server。

有没有人遇到过这个问题?