@@ -9,7 +9,7 @@ ARG RUNNER_CONTAINER_HOOKS_VERSION=0.6.1
9
9
WORKDIR C:/home/runner
10
10
11
11
# ###############################################################################
12
- # Use PowerShell for most installations
12
+ # Use PowerShell for initial installs
13
13
# ###############################################################################
14
14
SHELL ["powershell" , "-Command" , "$ErrorActionPreference='Stop';$ProgressPreference='SilentlyContinue';" ]
15
15
@@ -21,30 +21,30 @@ RUN Invoke-WebRequest -Uri "https://github.com/actions/runner/releases/download/
21
21
[System.IO.Compression.ZipFile]::ExtractToDirectory('actions-runner.zip' , $PWD); `
22
22
Remove-Item -Force actions-runner.zip
23
23
24
- # Install Chocolatey and tools (without refreshenv)
24
+ # ###############################################################################
25
+ # Install Chocolatey + tools (Git, Python, CMake, etc.)
26
+ # ###############################################################################
25
27
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; `
26
28
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072; `
27
29
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1' )); `
28
30
choco feature enable -n allowGlobalConfirmation; `
29
31
choco install -y git.install gh powershell-core azure-cli docker-cli docker-compose cmake python --installargs '"ADD_CMAKE_TO_PATH=System"'
30
32
31
- # Manually append Git and Python to PATH if needed
32
- RUN setx /M PATH "$($Env:PATH);C:\P rogram Files\G it\b in;C:\P ython313"
33
- # Add Git Bash to PATH
34
- RUN setx /M PATH "$($Env:PATH);C:\P rogram Files\G it\b in"
33
+ # Add Git & Python to PATH (paths with spaces are quoted)
34
+ RUN setx /M PATH "$Env:PATH;\" C:\P rogram Files\G it\b in\" ;C:\P ython313"
35
35
36
- # Enable long paths
36
+ # Enable long paths in Windows
37
37
RUN New-ItemProperty -Path "HKLM:\\ SYSTEM\\ CurrentControlSet\\ Control\\ FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
38
38
39
39
# ###############################################################################
40
- # Switch to cmd for VS installer
40
+ # Switch to CMD for VS Build Tools
41
41
# ###############################################################################
42
42
SHELL ["cmd" , "/S" , "/C" ]
43
43
44
44
# Download VS Build Tools installer
45
45
ADD https://aka.ms/vs/17/release/vs_buildtools.exe C:\T EMP\v s_buildtools.exe
46
46
47
- # Install VS Build Tools inside a single RUN
47
+ # Install VS Build Tools inside a single RUN instruction (no invalid Docker instructions)
48
48
RUN (start /w C:\T EMP\v s_buildtools.exe --quiet --wait --norestart --nocache `
49
49
--add Microsoft.VisualStudio.Workload.AzureBuildTools `
50
50
--add Microsoft.VisualStudio.Workload.VCTools `
@@ -55,15 +55,15 @@ RUN (start /w C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
55
55
|| IF "%ERRORLEVEL%" =="3010" EXIT 0) `
56
56
&& del /q C:\T EMP\v s_buildtools.exe
57
57
58
- # Add VS Build Tools to PATH
58
+ # Add VS Build Tools paths
59
59
RUN setx /M PATH "%PATH%;%ProgramFiles(x86)%\M icrosoft Visual Studio\2 022\B uildTools\C ommon7\T ools;%ProgramFiles(x86)%\M icrosoft Visual Studio\2 022\B uildTools\M SBuild\C urrent\B in"
60
60
61
61
# ###############################################################################
62
- # Switch back to PowerShell for Python, certs, vcpkg
62
+ # Switch back to PowerShell for Python certs and vcpkg
63
63
# ###############################################################################
64
64
SHELL ["powershell" , "-Command" ]
65
65
66
- # Upgrade Python packages & configure certs
66
+ # Configure Python certificates
67
67
RUN python -m pip install --upgrade certifi setuptools; `
68
68
setx SSL_CERT_FILE "C:\U sers\C ontainerAdministrator\A ppData\L ocal\P rograms\P ython\P ython310\L ib\s ite-packages\c ertifi\c acert.pem" ; `
69
69
certutil -generateSSTFromWU certs.sst; `
@@ -73,7 +73,7 @@ RUN python -m pip install --upgrade certifi setuptools; `
73
73
# Install vcpkg
74
74
RUN git clone https://github.com/microsoft/vcpkg.git C:\v cpkg; `
75
75
C:\v cpkg\b ootstrap-vcpkg.bat; `
76
- setx /M PATH "$($ Env:PATH) ;C:\v cpkg" ; `
76
+ setx /M PATH "$Env:PATH;C:\v cpkg" ; `
77
77
C:\v cpkg\v cpkg.exe install zlib:x64-windows --clean-after-build; `
78
78
C:\v cpkg\v cpkg.exe remove zlib:x64-windows
79
79
0 commit comments