Switch Windows helper image default from servercore to nanoserver
Problem
Currently, the GitLab Runner uses servercore as the default Windows helper image. However, nanoserver offers significant advantages that make it a better default choice.
Benefits
The primary advantage of this change is a massive reduction in the helper image size, dropping from 6.2GB to just 633MB.
REPOSITORY TAG IMAGE ID CREATED SIZE
gitlab-runner-helper x86_64-76c0cffb-nanoserver20H2 05fdc7e2f5cf 7 weeks ago 633MB
gitlab-runner-helper x86_64-76c0cffb-servercore20H2 ba555b9a56d0 3 months ago 6.2GBKey Advantages:
- ~90% Smaller Footprint: Reduces storage requirements and bandwidth usage.
- Drastically Faster Pull Times: Nanoserver pulls in a few minutes, compared to 10-15 minutes for Server Core.
- Improved Performance: A lighter image accelerates job execution and consumes fewer CI/CD resources.
- Modern Tooling: Nanoserver exclusively utilizes
Pwsh(PowerShell Core v7), aligning with modern cross-platform PowerShell practices.
Current State
servercoreis the default helper image and supports bothPowerShellandPwsh.nanoserverexists as an alternative and supports onlyPwshbut is not the default, and because of that users must explicitly configurenanoserverif they want to use it.
Proposed Solution
Make nanoserver the default Windows helper image for the docker-windows executor. This would:
- Reduce image size and pull times by default
- Improve performance for Windows CI/CD pipelines
- Align with modern PowerShell practices (pwsh is the recommended shell)
- Reduce infrastructure costs for users running Windows builds
Considerations
This is a breaking change for users writing PowerShell in hooks:pre_get_sources_script or hooks:post_get_sources_script, who must now explicitly configure servercore to retain legacy PowerShell support, or moving their scripts to Pwsh (which suppose to be pretty easy considering you are not suppose to write to much in the hooks section)
Related MR’s
Edited by Pishel