diff --git a/Jenkinsfile b/Jenkinsfile index 3027f5626..f6bd3dc50 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,13 +14,8 @@ def agentSelector(String imageType, retryCounter) { platform = 'windows-2019' break - // nanoserver-ltsc2022 and windowservercore-ltsc2022 - case ~/.*2022/: - platform = 'windows-2022' - break - - // nanoserver-ltsc2025 and windowservercore-ltsc2025 - case ~/.*2025/: + // All other Windows images + case ~/(nanoserver|windowsservercore).*/: platform = 'windows-2025' break @@ -60,9 +55,11 @@ def parallelStages = [failFast: false] node(resolvedAgentLabel) { timeout(time: 60, unit: 'MINUTES') { checkout scm - if (imageType == "linux") { - stage('Prepare Docker') { + stage('Prepare Docker') { + if (isUnix()) { sh 'make docker-init' + } else { + powershell '& ./build.ps1 docker-init' } } // This function is defined in the jenkins-infra/pipeline-library diff --git a/build.ps1 b/build.ps1 index bb49c3a7d..f474c46f6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -122,6 +122,15 @@ function Test-Image { return $failed } +function Get-DockerInfo() { + docker info + + # Additional system information + Get-ComputerInfo | Select-Object OsName, OsBuildNumber, WindowsVersion + Get-CimInstance -ClassName Win32_Processor | Out-String + Get-WindowsFeature Containers | Out-String +} + function Initialize-DockerComposeFile { param ( [String] $AgentType, @@ -173,6 +182,10 @@ Test-CommandExists 'docker-compose' Test-CommandExists 'docker buildx' Test-CommandExists 'yq' +if($target -eq 'docker-init') { + Get-DockerInfo +} + foreach($agentType in $AgentTypes) { $dockerComposeFile = 'build-windows_{0}_{1}.yaml' -f $AgentType, $ImageType $baseDockerCmd = 'docker-compose --file={0}' -f $dockerComposeFile