Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def agentSelector(String imageType) {
return 'docker-highmem'
}
}
// Windows Server Core 2022 agent
// 2022 and 2025 images build from a Windows Server Core 2025 agent
if (imageType.contains('2022')) {
return 'windows-2022'
return 'windows-2025'
}
// Windows Server Core 2019 agent (for nanoserver 1809 & ltsc2019 and for windowservercore ltsc2019)
return 'windows-2019'
Expand Down Expand Up @@ -64,9 +64,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
Expand Down
20 changes: 20 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ function Test-Image {
return $failed
}

function Initialize-Docker() {
# Cf https://github.com/jenkins-infra/jenkins-infra/blob/production/modules/profile/templates/jenkinscontroller/casc/clouds-ec2.yaml.erb
$dockerDaemonConfigPath = 'C:\ProgramData\Docker\config\daemon.json'
if (Test-Path $dockerDaemonConfigPath) {
$dockerDaemonConfig = Get-Content -Path $dockerDaemonConfigPath -Raw | ConvertFrom-Json
Write-Host "${dockerDaemonConfigPath} file content:"
$dockerDaemonConfig | ConvertTo-Json
}
# OS info
Get-ComputerInfo | Select-Object OsName, OsBuildNumber, WindowsVersion
# CPU info
Get-CimInstance -ClassName Win32_Processor | Out-String

Get-WindowsFeature Containers | Out-String
Invoke-Expression 'docker info'
}
function Initialize-DockerComposeFile {
$baseDockerBakeCmd = 'docker buildx bake --progress=plain --file=docker-bake.hcl'

Expand Down Expand Up @@ -157,6 +173,10 @@ Test-CommandExists 'docker-compose'
Test-CommandExists 'docker buildx'
Test-CommandExists 'yq'

if($target -eq 'docker-init') {
Initialize-Docker
}

# Generate the docker compose file if it doesn't exists or if the parameter OverwriteDockerComposeFile is set
if ((Test-Path $dockerComposeFile) -and -not $OverwriteDockerComposeFile) {
Write-Host "= PREPARE: The docker compose file '$dockerComposeFile' containing the image definitions already exists."
Expand Down