0

I started this line of thought with a question on how I could connect to a SQL Server database to a container that "contains" our application.

The answer I received was to simply build another container and link the two containers together. This seemed like a good answer and one that I have started to implement.

But on further reflection and with other comments I start to wonder if this is the best way forward. This may not be kosher but for the sake of completeness I reiterate my question. From a container how do I establish a connection between a container and an existing SQL Server database?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kevin Burton
  • 425
  • 2
  • 6
  • 11
  • You use the IP and port of the service and reach it using the same. But this may change based on the network you are in. So if you connect to Wifi the reachable address may change. Just see it as one machine trying to connect to SQL running on another machine – Tarun Lalwani Sep 25 '17 at 17:49
  • There must be something different and I don't know what all I need to consider. The existing "uncontainerized" application is a PHP backend that connects to the ww.xx.yy.zz,pp. The ,pp is a "port" that specifies a specific instance of the database server. The PHP driver apparently "knows" that pp is a specific instance and ww.xx.yy.zz is the server address. But when I connect using this address (ww.xx.yy.zz,pp) from the container the PHP driver throws an exception indicating that this server does not exist. Do I need to expose ports or open up networks? – Kevin Burton Sep 25 '17 at 18:56

0 Answers0