# SQL Server 2019 image for Windows Container

**URL:** <https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812>\
**Category:** General\
**Created:** [April 23, 2022, 8:21pm UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812 "2022-04-23T20:21:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanlijf1974](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/johanlijf1974/32/32896_2.png) [@johanlijf1974](https://forums.docker.com/u/johanlijf1974)\
**Post date:** [April 23, 2022, 8:21pm UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812/1 "2022-04-23T20:21:19Z")

</div>

Hello,

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

Thanks

---

<div class="post-metadata">

**Author:** ![pabechevb](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/pabechevb/32/32522_2.png) [@pabechevb](https://forums.docker.com/u/pabechevb)\
**Post date:** [April 25, 2022, 1:34pm UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812/2 "2022-04-25T13:34:49Z")

</div>

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](http://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](https://www.mssqltips.com/sqlservertip/7093/install-sql-server-install-oracle-powershell-windows-containers/)

---

<div class="post-metadata">

**Author:** ![johanlijf1974](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/johanlijf1974/32/32896_2.png) [@johanlijf1974](https://forums.docker.com/u/johanlijf1974)\
**Post date:** [April 29, 2022, 2:51pm UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812/3 "2022-04-29T14:51:00Z")

</div>

Hello,

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.

---

<div class="post-metadata">

**Author:** ![pabechevb](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/pabechevb/32/32522_2.png) [@pabechevb](https://forums.docker.com/u/pabechevb)\
**Post date:** [April 29, 2022, 4:31pm UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812/4 "2022-04-29T16:31:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johanlijf1974](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/johanlijf1974/32/32896_2.png) [@johanlijf1974](https://forums.docker.com/u/johanlijf1974)\
**Post date:** [April 29, 2022, 9:53pm UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812/5 "2022-04-29T21:53:47Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![davidbcn86](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/davidbcn86/32/45901_2.png) [@davidbcn86](https://forums.docker.com/u/davidbcn86)\
**Post date:** [March 1, 2024, 10:12am UTC](https://forums.docker.com/t/sql-server-2019-image-for-windows-container/123812/6 "2024-03-01T10:12:29Z")

</div>

I made an attempt at building a SQL Server Image: [windowscontainers/sqlserver2022base at master · david-garcia-garcia/windowscontainers (github.com)](https://github.com/david-garcia-garcia/windowscontainers/tree/master/sqlserver2022base)

The image has env configuration to set an admin user and to relocate system and user databases, so it can be used to host databases even in non state persistent environments (i.e. K8S) with ease.
