SQL Server 2019 image for Windows Container


Are there any SQL server 2019 (not express) images available for Windows Containers?


There aren’t, but you can build your own with the following steps:

  1. Pull Windows Server Core 2019 image: docker pull mcr.microsoft.com/windows/servercore:ltsc2019
  2. Start a container sharing a folder with it: docker run -it --name MyContainer -v C:\temp:C:\setup mcr microsoft com /windows/servercore:ltsc2019 powershell
  3. Once downloaded from Microsoft, install it within the container: & “c:\setup\setup.exe” /Q /Action=Install /IAcceptSQLServerLicenseTerms /IndicateProgress /Features=SQLEngine,Conn /InstanceName=MSSQLSERVER /TcpEnabled=1 /SecurityMode=SQL /SaPwd=@Sq1T3st /SqlSysAdminAccounts=“ContainerAdministrator”

More information in this tip: Install SQL Server and Oracle on Windows Containers


Got a little further and have MSSQL 2019 installed within a container. Only thing is now i can ping the container but i can not reach it with SQL manager from outside the container. It seems like the MSSQL Server is not available.

Correct, in order for it to be reachable outside, you need to expose port 1433 when you create the container, see my other mssqltips on how to do that.

Got it working. Your article gave me the answer. For the SqlSysAdminAccounts=“ContainerAdministrator” i had the builtin\Administrators. After changing this to ContainerAdministrator i got functioning container with mssql2019. So thanks for that!

1 Like