exec command with docker executor on Windows tries to mount invalid directories

How to reproduce
  • On Windows, create a new directory, e.g. c:\test.

  • In this directory, create a .gitlab-ci.yml:

repro:
  image: alpine:latest
  script:
  - echo Hello
  • Run these commands:
cd c:\test
git init
git add .
git commit
gitlab-runner exec docker repro
Expected result

The build script runs.

Actual result
ERROR: Job failed (system failure):
Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/test:c:/test:ro'
(executor_docker.go:921:0s)

If I see this correctly, the path outside the container (c:\builds\project-0\test) doesn't exist and the path inside the container (c:/test) is not a valid path for a Linux container.

And shouldn't it be rw instead of ro by the way?

Edited by André Hänsel