Skip to content

Doesn't work: Gitlab Runner to run Windows docker container on Windows host

The case: Run a Windows CI with Gitlab Runner on a Windows host executing in a Windows container.

The problem: This doesn't work as current Gitlab Runner version (14.10.1).

Details:

I have tried four types of Windows runner workflow on my computer:

  1. shell executor: this work well
  2. docker executor: this is only useful to run Linux container, and this work well.
  3. docker-windows executor: this is only useful to run Windows container, this doesn't work
  4. docker-windows executor with docker-in-docker: this is only useful to run docker commands in a docker container. This is for CI jobs which build/pull/push docker images. This doesn't work.

Tests for each of these case can be found in: /.gitlab-ci-runner-tests.yml and are run in this project's CI.

For the docker-windows executor, there is a known bug (but not resolved yet): https://gitlab.com/gitlab-org/gitlab-runner/-/issues/28398

It seems (see in comments in previous link) this can be solved by using a Windows Server as host computer instead of a Windows Pro.

For the dind with docker-windows executor, this seems to not be fully supported. One of the info I found is that the runner must lunch the docker in privileged mode which is not supported in Windows.

Workaround:

The workaround for Windows compile is to use the shell executor. This required to have all the required environment tools installed on the runner computer.