Docker Community Forums

Share and learn in the Docker community.

Cannot connect to Remote SQL Server


(Stephenvelluto) #1

I’m having trouble with connecting to a Remote SQL Server Instance.

My container, right now, is fairly basic, it just contains a WebApi2 Website, using microsoft/iis as the base image.

Our SQL Server is hosted on a Development server elsewhere on our network.

Running the application on my machine connects to the server just fine, but through the container it is not able to connect.

The SQL Server is an instance, and I have tried multiple connection strings (with and without ports), and added the server to the Hosts file, etc. All with no luck. I keep getting Unable to find server, or timeout errors.

Any help would be appreciated!


(Sam) #2

what is the ip address of the sql server?

if you docker attach web_container_id
can you ping the sql server address?


(Stephenvelluto) #3

Yes, I was able to Ping the SQL Server.

Also - I ran another test, where my WebAPI would just make a call to our production API through a regular web call, and that request also did not go out.


(Sam) #4

is there a firewall on the sql server? does it allow the ip address of the container to go thru?


(Stephenvelluto) #5

There is no firewall for the SQL Server for internal traffic.

I’ve done some packet tracing, and there are no packets coming out of this container to any of the other servers. The only traffic I see is the requests being made to the WebApi, and it’s response.

It sounds to me like there is a firewall in the container that is preventing outbound connections?


(Stephenvelluto) #6

I’ve figured it out. It has nothing to do with Docker or Windows… it’s Symantec.

I found this forum post: https://github.com/docker/for-win/issues/1397

I’m using the same version of Symantec Endpoint, and once I disabled it, the container was able to communicate to the outside world.

Hopefully Symantec puts out a fix soon.

Thanks.