From 097e28c9d7d1650c88af5ac591be7b2fd338bab2 Mon Sep 17 00:00:00 2001 From: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Date: Mon, 22 Jan 2024 21:29:42 +0100 Subject: [PATCH] [Windows] Pin Docker 24.0.7 to avoid bugs (#9208) * [Windows] Pin Docker 24.0.7 to avoid bugs * Fix typos, avoid using special characters --- images/windows/scripts/build/Install-Docker.ps1 | 8 ++++---- images/windows/scripts/build/Install-DockerCompose.ps1 | 4 +++- images/windows/toolsets/toolset-2019.json | 6 +++++- images/windows/toolsets/toolset-2022.json | 6 +++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/images/windows/scripts/build/Install-Docker.ps1 b/images/windows/scripts/build/Install-Docker.ps1 index cc353a1b76be..5eabf994079a 100644 --- a/images/windows/scripts/build/Install-Docker.ps1 +++ b/images/windows/scripts/build/Install-Docker.ps1 @@ -6,13 +6,13 @@ ################################################################################ Write-Host "Get latest Moby release" -$mobyLatestVersion = (Get-GithubReleasesByVersion -Repo "moby/moby" -Version "latest").version - +$toolsetVersion = (Get-ToolsetContent).docker.components.docker +$mobyVersion = (Get-GithubReleasesByVersion -Repo "moby/moby" -Version "${toolsetVersion}").version $dockerceUrl = "https://download.docker.com/win/static/stable/x86_64/" $dockerceBinaries = Invoke-WebRequest -Uri $dockerceUrl -UseBasicParsing -Write-Host "Check Moby version $mobyLatestVersion" -$mobyRelease = $dockerceBinaries.Links.href -match "${mobyLatestVersion}\.zip" | Select-Object -Last 1 +Write-Host "Check Moby version $mobyVersion" +$mobyRelease = $dockerceBinaries.Links.href -match "${mobyVersion}\.zip" | Select-Object -Last 1 if (-not $mobyRelease) { Write-Host "Release not found for $mobyLatestRelease version" $versions = [regex]::Matches($dockerceBinaries.Links.href, "docker-(\d+\.\d+\.\d+)\.zip") | Sort-Object { [version] $_.Groups[1].Value } diff --git a/images/windows/scripts/build/Install-DockerCompose.ps1 b/images/windows/scripts/build/Install-DockerCompose.ps1 index a297275e41c2..962b396cb204 100644 --- a/images/windows/scripts/build/Install-DockerCompose.ps1 +++ b/images/windows/scripts/build/Install-DockerCompose.ps1 @@ -10,7 +10,9 @@ Install-ChocoPackage docker-compose -ArgumentList "--version=$versionToInstall" Write-Host "Install-Package Docker-Compose v2" # Temporaty pinned to v2.23.3 due https://github.com/actions/runner-images/issues/9172 -$dockerComposev2Url = "https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-windows-x86_64.exe" +$toolsetVersion = (Get-ToolsetContent).docker.components.compose +$composeVersion = (Get-GithubReleasesByVersion -Repo "docker/compose" -Version "${toolsetVersion}").version +$dockerComposev2Url = "https://github.com/docker/compose/releases/download/v${composeVersion}/docker-compose-windows-x86_64.exe" $cliPluginsDir = "C:\ProgramData\docker\cli-plugins" New-Item -Path $cliPluginsDir -ItemType Directory Invoke-DownloadWithRetry -Url $dockerComposev2Url -Path "$cliPluginsDir\docker-compose.exe" diff --git a/images/windows/toolsets/toolset-2019.json b/images/windows/toolsets/toolset-2019.json index b4ecc5fd6549..3d468e8d77fe 100644 --- a/images/windows/toolsets/toolset-2019.json +++ b/images/windows/toolsets/toolset-2019.json @@ -383,7 +383,11 @@ "mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019", "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019", "mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019" - ] + ], + "components": { + "docker": "24.0.7", + "compose": "2.23.3" + } }, "pipx": [ { diff --git a/images/windows/toolsets/toolset-2022.json b/images/windows/toolsets/toolset-2022.json index d6009b1aa550..b73a0522bca0 100644 --- a/images/windows/toolsets/toolset-2022.json +++ b/images/windows/toolsets/toolset-2022.json @@ -330,7 +330,11 @@ "mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2022", "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022", "mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022" - ] + ], + "components": { + "docker": "24.0.7", + "compose": "2.23.3" + } }, "pipx": [ {