File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,17 @@ stage('Build') {
5757 }
5858
5959 withEnv([" IMAGE_TYPE=${ imageType} " ]) {
60+ stage(' Prepare Docker' ) {
61+ infra. withDockerCredentials {
62+ powershell ' ./make.ps1 -Target docker-init'
63+ }
64+ }
6065 if (! infra. isTrusted()) {
6166 /* Outside of the trusted.ci environment, we're building and testing
6267 * the Dockerfile in this repository, but not publishing to docker hub
6368 */
6469 stage(" Build ${ imageType} " ) {
6570 infra. withDockerCredentials {
66- powershell ' docker info'
6771 powershell ' ./make.ps1 build'
6872 }
6973 }
Original file line number Diff line number Diff line change @@ -62,6 +62,30 @@ $env:COMMIT_SHA=$(git rev-parse HEAD)
6262$baseDockerCmd = ' docker-compose --file=build-windows.yaml'
6363$baseDockerBuildCmd = ' {0} build --parallel --pull' -f $baseDockerCmd
6464
65+ function Initialize-Docker () {
66+ # Cf https://github.com/jenkins-infra/jenkins-infra/blob/production/modules/profile/templates/jenkinscontroller/casc/clouds-ec2.yaml.erb
67+ $dockerDaemonConfigPath = ' C:\ProgramData\Docker\config\daemon.json'
68+ if (Test-Path $dockerDaemonConfigPath ) {
69+ $dockerDaemonConfig = Get-Content - Path $dockerDaemonConfigPath - Raw | ConvertFrom-Json
70+ Write-Host " ${dockerDaemonConfigPath} file content:"
71+ $dockerDaemonConfig | ConvertTo-Json
72+ # Remove docker daemon config setting "data-root" to Z:\docker (NVMe mount) to avoid hitting moby/moby#48093
73+ Remove-Item - Path $dockerDaemonConfigPath
74+ Restart-Service docker
75+ }
76+ Get-ComputerInfo | Select-Object OsName, OsBuildNumber, WindowsVersion
77+ Get-WindowsFeature Containers | Out-String
78+ Invoke-Expression ' docker info'
79+ Get-CimInstance - ClassName Win32_Processor
80+ Get-ChildItem env: | Select-Object Name, Value
81+ }
82+
83+ if ($target -eq ' docker-init' ) {
84+ Write-Host ' = Initialize-Docker then exit'
85+ Initialize-Docker
86+ exit 0
87+ }
88+
6589Write-Host " = PREPARE: List of $Organisation /$Repository images and tags to be processed:"
6690Invoke-Expression " $baseDockerCmd config"
6791
You can’t perform that action at this time.
0 commit comments