Skip to content

Commit 48dd555

Browse files
committed
workflows: Windows Docker insufficient disk space fix
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
1 parent 3e414ac commit 48dd555

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,25 @@ 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+
if (Test-Path -Path "D:\") {
118+
$newSystemTempDir = "D:\SystemTemp"
119+
New-Item -ItemType Directory -Path "${newSystemTempDir}" -Force
120+
$acl = New-Object System.Security.AccessControl.DirectorySecurity
121+
$acl.SetSecurityDescriptorSddlForm("O:SYG:SYD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)")
122+
Set-Acl "${newSystemTempDir}" -AclObject $acl
123+
[Environment]::SetEnvironmentVariable("SYSTEMTEMP", "${newSystemTempDir}", [EnvironmentVariableTarget]::Machine
124+
Restart-Service docker
125+
} else {
126+
Write-Warning "Drive D doesn't exist, so there is no disk to relocate system temp directory"
127+
}
128+
shell: pwsh
129+
111130
- name: Build the windows images
112131
id: build
113132
run: |

0 commit comments

Comments
 (0)