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.2GB

Key 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

  • servercore is the default helper image and supports both PowerShell and Pwsh.
  • nanoserver exists as an alternative and supports only Pwsh but is not the default, and because of that users must explicitly configure nanoserver if they want to use it.

Proposed Solution

Make nanoserver the default Windows helper image for the docker-windows executor. This would:

  1. Reduce image size and pull times by default
  2. Improve performance for Windows CI/CD pipelines
  3. Align with modern PowerShell practices (pwsh is the recommended shell)
  4. 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)

!3460 (merged) !6525 (merged)

Edited by Pishel