Skip to content

Commit 2cf6b4f

Browse files
committed
test: remove docker daemon config
1 parent ca0c906 commit 2cf6b4f

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Jenkinsfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ def parallelStages = [failFast: false]
5555
node(resolvedAgentLabel) {
5656
timeout(time: 60, unit: 'MINUTES') {
5757
checkout scm
58-
if (imageType == "linux") {
59-
stage('Prepare Docker') {
58+
stage('Prepare Docker') {
59+
if (isUnix()) {
6060
sh 'make docker-init'
61+
} else {
62+
powershell '& ./build.ps1 docker-init'
6163
}
6264
}
6365
// This function is defined in the jenkins-infra/pipeline-library

build.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ function Test-Image {
122122
return $failed
123123
}
124124

125+
function Initialize-Docker() {
126+
docker info
127+
# Cf https://github.com/jenkins-infra/jenkins-infra/blob/production/modules/profile/templates/jenkinscontroller/casc/clouds-ec2.yaml.erb
128+
$dockerDaemonConfigPath = 'C:\ProgramData\Docker\config\daemon.json'
129+
if (Test-Path $dockerDaemonConfigPath) {
130+
$dockerDaemonConfig = Get-Content -Path $dockerDaemonConfigPath -Raw | ConvertFrom-Json
131+
Write-Host "${dockerDaemonConfigPath} file content:"
132+
$dockerDaemonConfig | ConvertTo-Json
133+
}
134+
# System information
135+
Get-ComputerInfo | Select-Object OsName, OsBuildNumber, WindowsVersion
136+
Get-CimInstance -ClassName Win32_Processor | Out-String
137+
Get-WindowsFeature Containers | Out-String
138+
docker info
139+
}
140+
125141
function Initialize-DockerComposeFile {
126142
param (
127143
[String] $AgentType,
@@ -173,6 +189,10 @@ Test-CommandExists 'docker-compose'
173189
Test-CommandExists 'docker buildx'
174190
Test-CommandExists 'yq'
175191

192+
if($target -eq 'docker-init') {
193+
Initialize-Docker
194+
}
195+
176196
foreach($agentType in $AgentTypes) {
177197
$dockerComposeFile = 'build-windows_{0}_{1}.yaml' -f $AgentType, $ImageType
178198
$baseDockerCmd = 'docker-compose --file={0}' -f $dockerComposeFile

0 commit comments

Comments
 (0)