diff --git a/images/win/scripts/Installers/Install-Docker.ps1 b/images/win/scripts/Installers/Install-Docker.ps1 index 71dbd6cf..28efff98 100644 --- a/images/win/scripts/Installers/Install-Docker.ps1 +++ b/images/win/scripts/Installers/Install-Docker.ps1 @@ -10,6 +10,11 @@ $instScriptUrl = "https://raw.githubusercontent.com/microsoft/Windows-Containers $instScriptPath = Start-DownloadWithRetry -Url $instScriptUrl -Name "install-docker-ce.ps1" & $instScriptPath +# Fix AZ CLI DOCKER_COMMAND_ERROR +# cli.azure.cli.command_modules.acr.custom: Could not run 'docker.exe' command. +# https://github.com/Azure/azure-cli/issues/18766 +New-Item -ItemType SymbolicLink -Path "C:\Windows\SysWOW64\docker.exe" -Target "C:\Windows\System32\docker.exe" + Write-Host "Install-Package Docker-Compose v1" Choco-Install -PackageName docker-compose @@ -21,9 +26,8 @@ Start-DownloadWithRetry -Url $dockerComposev2Url -Name docker-compose.exe -Downl Write-Host "Install docker-wincred" $dockerCredLatestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/docker/docker-credential-helpers/releases/latest" -$dockerCredDownloadUrl = $dockerCredLatestRelease.assets.browser_download_url -match "docker-credential-wincred-.+\.zip" | Select-Object -First 1 -$dockerCredArchive = Start-DownloadWithRetry -Url $dockerCredDownloadUrl -Expand-Archive -Path $dockerCredArchive -DestinationPath "C:\Windows\System32" +$dockerCredDownloadUrl = $dockerCredLatestRelease.assets.browser_download_url -match "docker-credential-wincred-.+\.exe" | Select-Object -First 1 +Start-DownloadWithRetry -Url $dockerCredDownloadUrl -DownloadPath "C:\Windows\System32" -Name "docker-credential-wincred.exe" Write-Host "Download docker images" $dockerImages = (Get-ToolsetContent).docker.images diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 1f553d11..30c5e495 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -66,7 +66,7 @@ function Get-DockerComposeVersionV2 { } function Get-DockerWincredVersion { - $dockerCredVersion = $(docker-credential-wincred version) + $dockerCredVersion = docker-credential-wincred version | Take-Part -Part 2 | Take-Part -Part 0 -Delimiter "v" return "Docker-wincred $dockerCredVersion" } diff --git a/images/win/scripts/Tests/Docker.Tests.ps1 b/images/win/scripts/Tests/Docker.Tests.ps1 index 4e6a27cd..4b4b2a36 100644 --- a/images/win/scripts/Tests/Docker.Tests.ps1 +++ b/images/win/scripts/Tests/Docker.Tests.ps1 @@ -17,6 +17,10 @@ Describe "Docker" { It "docker service is up" { "docker images" | Should -ReturnZeroExitCode } + + It "docker symlink" { + "C:\Windows\SysWOW64\docker.exe ps" | Should -ReturnZeroExitCode + } } Describe "DockerImages" {