Docker-windows-executor runner support for Windows ARM64

Description

We would like to be able to run ci/cd jobs on Windows ARM64, using docker-windows-executor. We have been using docker on windows arm64, with process isolation.

The problem is that whilst AMD64 binaries can run on Windows ARM64, it appears when a AMD64 based docker image is cannot load on windows ARM64. Whilst the AMD64 gitlab-runner binary appears to work on ARM64, the docker-windows-executor will load a servercore2022 (amd64) based docker image, and the job will fail. The following error is reported:

sha256:<redacted>
ERROR: Job failed (system failure): prepare environment: Error response from daemon: container <redacted> encountered an error during hcs::System::Start: failure in a Windows system call: The virtual machine or container exited unexpectedly. (0xc0370106) (exec.go:72:0s). Check https://docs.gitlab.com/runner/shells/#shell-profile-loading for more information

I have noticed that The virtual machine or container exited unexpectedly error message occurs when attempting to load a AMD64 image.

Proposal

Microsoft does provide base ARM64 docker images, ltsc2025-arm64. See https://github.com/microsoft/Windows-Containers/issues/586, https://mcr.microsoft.com/v2/windows/nanoserver/tags/list, https://mcr.microsoft.com/v2/windows/servercore/tags/list

Current workaround used is to build a custom helper-image based on servercore:ltsc2025-arm64, and this works.

The minimum required change is to provide a helper-image that is based on ltsc2025-arm64. Customers can then override their runner settings to point to this image. Further changes would be helpful are:

  • Build and use an ARM64 based helper.exe within the helper-image. Also use ARM64 based git, git-lfs and pwsh (the latter two should be easy, but using arm-based git requires an upgrade to a newer version of git that what is currently used)
    • Depends on https://gitlab.com/gitlab-org/ci-cd/runner-tools/base-images/ updating to providing ltsc2025-arm64 variant of the base-image.
  • Provide an ARM64 based gitlab-runner.exe
  • Automatically detect that the runner is running on an ARM64 machine and use the appropriate image.

Links to related issues and merge requests / references

Assignee Loading
Time tracking Loading