Skip to content

Commit 37532c9

Browse files
authored
Create dockerfile_1
SQL 2019 Dockerfile
1 parent dc48d74 commit 37532c9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SQL Server 2019 Windows container dockerfile
2+
## Warning: Restarting windows container causes the machine key to change and hence if you have any encryption configured then restarting SQL On Windows containers
3+
## breaks the encryption key chain in SQL Server.
4+
5+
# Download the SQL Developer from the following location https://go.microsoft.com/fwlink/?linkid=866662 and extract the .box and .exe files using the option: "Download Media"
6+
7+
FROM mcr.microsoft.com/windows/servercore:ltsc2019
8+
9+
ENV sa_password="_" \
10+
attach_dbs="[]" \
11+
ACCEPT_EULA="_" \
12+
sa_password_path="C:\ProgramData\Docker\secrets\sa-password"
13+
14+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
15+
16+
# make install files accessible
17+
COPY start.ps1 /
18+
COPY SQLServer2019-DEV-x64-ENU.box /
19+
COPY SQLServer2019-DEV-x64-ENU.exe /
20+
COPY SQLServer2019-DEV-x64-ENU /
21+
22+
WORKDIR /
23+
24+
RUN Start-Process -Wait -FilePath .\SQLServer2019-DEV-x64-ENU.exe -ArgumentList /qs, /x:setup ; \
25+
.\setup\setup.exe /q /ACTION=Install /INSTANCENAME=MSSQLSERVER /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\NETWORK SERVICE' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS ; \
26+
Remove-Item -Recurse -Force SQLServer2019-DEV-x64-ENU.exe, SQLServer2019-DEV-x64-ENU.box, setup
27+
28+
RUN stop-service MSSQLSERVER ; \
29+
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql15.MSSQLSERVER\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpdynamicports -value '' ; \
30+
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql15.MSSQLSERVER\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpport -value 1433 ; \
31+
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql15.MSSQLSERVER\mssqlserver\' -name LoginMode -value 2 ;
32+
33+
HEALTHCHECK CMD [ "sqlcmd", "-Q", "select 1" ]
34+
35+
CMD .\start -sa_password $env:sa_password -ACCEPT_EULA $env:ACCEPT_EULA -attach_dbs \"$env:attach_dbs\" -Verbose

0 commit comments

Comments
 (0)