Skip to content

Commit 6aa60cd

Browse files
committed
workflows: Windows Docker insufficient disk space fix
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
1 parent 7d5942b commit 6aa60cd

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/call-build-images.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,26 @@ jobs:
413413
username: ${{ inputs.username }}
414414
password: ${{ secrets.token }}
415415

416+
# https://github.com/actions/runner-images/issues/12199
417+
# https://github.com/moby/moby/issues/48093
418+
# https://support.microsoft.com/en-us/topic/gettemppath-changes-in-windows-february-cumulative-update-preview-4cc631fb-9d97-4118-ab6d-f643cd0a7259#ID0EDF
419+
- name: Change system temp directory to the drive having sufficient disk space
420+
id: relocate-system-temp-dir
421+
run: |
422+
$ErrorActionPreference = "Stop"
423+
if (Test-Path -Path "D:\") {
424+
$newSystemTempDir = "D:\SystemTemp"
425+
New-Item -ItemType Directory -Path "${newSystemTempDir}" -Force
426+
$acl = New-Object System.Security.AccessControl.DirectorySecurity
427+
$acl.SetSecurityDescriptorSddlForm("O:SYG:SYD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)")
428+
Set-Acl "${newSystemTempDir}" -AclObject ${acl}
429+
[Environment]::SetEnvironmentVariable("SYSTEMTEMP", "${newSystemTempDir}", [EnvironmentVariableTarget]::Machine)
430+
Restart-Service docker
431+
} else {
432+
Write-Warning "Drive D doesn't exist, so there is no disk to relocate system temp directory"
433+
}
434+
shell: pwsh
435+
416436
- name: Pull the last release image to speed up the build with a cache
417437
continue-on-error: true
418438
run: |

.github/workflows/pr-image-tests.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,26 @@ jobs:
108108
flavor: |
109109
suffix=-windows-${{ matrix.windows-base-version }}
110110
111+
# https://github.com/actions/runner-images/issues/12199
112+
# https://github.com/moby/moby/issues/48093
113+
# https://support.microsoft.com/en-us/topic/gettemppath-changes-in-windows-february-cumulative-update-preview-4cc631fb-9d97-4118-ab6d-f643cd0a7259#ID0EDF
114+
- name: Change system temp directory to the drive having sufficient disk space
115+
id: relocate-system-temp-dir
116+
run: |
117+
$ErrorActionPreference = "Stop"
118+
if (Test-Path -Path "D:\") {
119+
$newSystemTempDir = "D:\SystemTemp"
120+
New-Item -ItemType Directory -Path "${newSystemTempDir}" -Force
121+
$acl = New-Object System.Security.AccessControl.DirectorySecurity
122+
$acl.SetSecurityDescriptorSddlForm("O:SYG:SYD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)")
123+
Set-Acl "${newSystemTempDir}" -AclObject ${acl}
124+
[Environment]::SetEnvironmentVariable("SYSTEMTEMP", "${newSystemTempDir}", [EnvironmentVariableTarget]::Machine)
125+
Restart-Service docker
126+
} else {
127+
Write-Warning "Drive D doesn't exist, so there is no disk to relocate system temp directory"
128+
}
129+
shell: pwsh
130+
111131
- name: Build the windows images
112132
id: build
113133
run: |

0 commit comments

Comments
 (0)