WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 73356b1

Browse files
committed
adding switch to linux docker containers
1 parent c6d4399 commit 73356b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

azure-pipelines/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ steps:
7979

8080
- pwsh: |
8181
# setup docker image for SQL 2025
82+
83+
# Switch to Linux containers if currently on Windows
84+
$currentOs = docker version --format '{{.Server.Os}}'
85+
Write-Host "Current Docker OS: $currentOs"
86+
87+
if ($currentOs -match "windows") {
88+
Write-Host "Switching to Linux containers..."
89+
& DockerCli.exe -SwitchDaemon
90+
Start-Sleep -Seconds 10
91+
Write-Host "New Docker OS: $(docker version --format '{{.Server.Os}}')"
92+
}
93+
8294
# generate random password of 24 characters, save to a script variable
8395
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%^&*()'
8496
$password = -join (1..24 | ForEach-Object { $chars[(Get-Random -Maximum $chars.Length)] })

0 commit comments

Comments
 (0)