Skip to content

Commit 4544117

Browse files
committed
Specify tag for Docker images
This should prevent pipelines accidentally breaking when Microsoft updates the Docker images.
1 parent 3348cb8 commit 4544117

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: install.ps1

+13-1
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,20 @@ forceencryption = 1
109109
$ToolsPath = "/opt/mssql-tools"
110110
}
111111

112+
switch($Version) {
113+
"2017" {
114+
$Tag = "CU31-GDR2-ubuntu-18.04"
115+
}
116+
"2019" {
117+
$Tag = "CU28-ubuntu-20.04"
118+
}
119+
"2022" {
120+
$Tag = "CU14-ubuntu-22.04"
121+
}
122+
}
123+
112124
Write-Output "Starting a Docker Container"
113-
Invoke-Expression "docker run --name=`"sql`" -e `"ACCEPT_EULA=Y`"-e `"SA_PASSWORD=$SaPassword`" -e `"MSSQL_PID=Express`" --health-cmd=`"$ToolsPath/bin/sqlcmd -C -S localhost -U sa -P '$SaPassword' -Q 'SELECT 1' -b -o /dev/null`" --health-start-period=`"10s`" --health-retries=3 --health-interval=`"10s`" -p 1433:1433 $AdditionalContainerConfiguration -d `"mcr.microsoft.com/mssql/server:$Version-latest`""
125+
Invoke-Expression "docker run --name=`"sql`" -e `"ACCEPT_EULA=Y`"-e `"SA_PASSWORD=$SaPassword`" -e `"MSSQL_PID=Express`" --health-cmd=`"$ToolsPath/bin/sqlcmd -C -S localhost -U sa -P '$SaPassword' -Q 'SELECT 1' -b -o /dev/null`" --health-start-period=`"10s`" --health-retries=3 --health-interval=`"10s`" -p 1433:1433 $AdditionalContainerConfiguration -d `"mcr.microsoft.com/mssql/server:$Version-$Tag`""
114126
Wait-ForContainer
115127
}
116128

0 commit comments

Comments
 (0)