SQL Server instance string connection in Linux Docker

I’m publishing an application to docker image microsoft/dotnet:1.0.1-core that reference Sql Server instance in connection string:

"Data Source=host\instance;Initial Catalog=database;User ID=user;Password=pass;"

In Windows environment it work’s as well, but using docker, the application cannot connect to the database. Changing the Data Source to use port instead of instance it works.

  • How to get running sum of a column in sql server
  • GROUP BY with summing null values to every group
  • SQL - Use results of one query as search criteria for another query
  • Convert From Bigint to datetime value
  • Table Value Parameter from c#
  • Entity Framework: The argument to DbIsNullExpression must refer to a primitive or reference type
  • "Data Source=host,port;Initial Catalog=database;User ID=user;Password=pass;"

    How can I connect, from docker, to Sql Server using instance instead port?

  • How to force default values in an insert with EntityFramework core?
  • Fluent API left join in Entity Framework Core
  • DotnetCore app running within Docker on Amazon Linux multidocker container returns an error during Sql Server login process
  • AWS Lambda - Unable to connect to SQL Server RDS in VPC
  • What would prevent code running in a Docker container from connecting to a database on a separate server?
  • Can't connect to SQL 2008 database using .NET Core 2.0
  • One Solution collect form web for “SQL Server instance string connection in Linux Docker”

    According to Saurabh Singh from Microsoft:

    The Instance name support is available in v 1.1 of .Net Core.
    In v1.0 of .Net Core, Instance names are not supported on OS other than Windows.

    So I don’t think you can connect from .Net Core 1.0 running on Linux to an SQL Server using instance name.

    Your choices seem to be:

    • don’t use instance name
    • wait for .Net Core 1.1 (planned for “Fall 2016”)
    • use pre-release version of .Net Core 1.1
    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.