Resolve Moby issue preventing Windows container executor from working
Summary
https://github.com/moby/moby/pull/35159 is needed to ensure directory creation works for Docker containers on Windows. That PR was abandoned by the original submitter, but is close. The new PR is https://github.com/moby/moby/pull/38465
**Important note: ** This is a bug in Moby, not a bug in GitLab. Resolving this issue requires submitting a PR to Moby.
Steps to reproduce
Attempt to run a Docker container on Windows and see that the directory creation does not occur.
Actual behavior
Directory creation does not occur, and the user is faced with the following issue when trying to create the container
ERROR: Job failed (system failure): Error response from daemon: container 094b2524bdf0050f94453ad7d450fcc2dc15f09eb33fa245fafbd886285e4d2b encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"CommandLine":"powershell","User":"ContainerAdministrator","WorkingDirectory":"C:\\","Environment":{"CI":"true","CI_API_V4_URL":"http://192.168.1.79:3000/api/v4","CI_BUILD_BEFORE_SHA":"0000000000000000000000000000000000000000","CI_BUILD_ID":"1703","CI_BUILD_NAME":"test","CI_BUILD_REF":"8a601760708bd5bab05887167aa5071574dcc7cc","CI_BUILD_REF_NAME":"windows-docker-executor","CI_BUILD_REF_SLUG":"windows-docker-executor","CI_BUILD_STAGE":"test","CI_BUILD_TOKEN":"xxxxxxxxxxxxxxxxxxxx","CI_COMMIT_BEFORE_SHA":"0000000000000000000000000000000000000000","CI_COMMIT_DESCRIPTION":"","CI_COMMIT_MESSAGE":"Update .gitlab-ci.yml","CI_COMMIT_REF_NAME":"windows-docker-executor","CI_COMMIT_REF_SLUG":"windows-docker-executor","CI_COMMIT_SHA":"8a601760708bd5bab05887167aa5071574dcc7cc","CI_COMMIT_SHORT_SHA":"8a601760","CI_COMMIT_TITLE":"Update .gitlab-ci.yml","CI_CONFIG_PATH":".gitlab-ci.yml","CI_DISPOSABLE_ENVIRONMENT":"true","CI_JOB_ID":"1703","CI_JOB_NAME":"test","CI_JOB_STAGE":"test","CI_JOB_TOKEN":"xxxxxxxxxxxxxxxxxxxx","CI_JOB_URL":"http://192.168.1.79:3000/root/ci-scratch-pad/-/jobs/1703","CI_NODE_TOTAL":"1","CI_PAGES_DOMAIN":"127.0.0.1.xip.io","CI_PAGES_URL":"http://root.127.0.0.1.xip.io:3010/ci-scratch-pad","CI_PIPELINE_ID":"241","CI_PIPELINE_IID":"162","CI_PIPELINE_SOURCE":"web","CI_PIPELINE_URL":"http://192.168.1.79:3000/root/ci-scratch-pad/pipelines/241","CI_PROJECT_DIR":"c:\\builds\\root\\ci-scratch-pad","CI_PROJECT_ID":"28","CI_PROJECT_NAME":"ci-scratch-pad","CI_PROJECT_NAMESPACE":"root","CI_PROJECT_PATH":"root/ci-scratch-pad","CI_PROJECT_PATH_SLUG":"root-ci-scratch-pad","CI_PROJECT_URL":"http://192.168.1.79:3000/root/ci-scratch-pad","CI_PROJECT_VISIBILITY":"public","CI_REGISTRY":"127.0.0.1:5000","CI_REGISTRY_IMAGE":"127.0.0.1:5000/root/ci-scratch-pad","CI_REGISTRY_PASSWORD":"xxxxxxxxxxxxxxxxxxxx","CI_REGISTRY_USER":"gitlab-ci-token","CI_REPOSITORY_URL":"http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@192.168.1.79:3000/root/ci-scratch-pad.git","CI_RUNNER_DESCRIPTION":"windows-2019","CI_RUNNER_EXECUTABLE_ARCH":"windows/amd64","CI_RUNNER_ID":"27","CI_RUNNER_REVISION":"f9cc22e0","CI_RUNNER_TAGS":"windows","CI_RUNNER_VERSION":"11.10.0~beta.1198.gf9cc22e0","CI_SERVER":"yes","CI_SERVER_NAME":"GitLab","CI_SERVER_REVISION":"00e5d66d231","CI_SERVER_VERSION":"11.9.0-pre","CI_SERVER_VERSION_MAJOR":"11","CI_SERVER_VERSION_MINOR":"9","CI_SERVER_VERSION_PATCH":"0","ENV":"asdf","FF_K8S_USE_ENTRYPOINT_OVER_COMMAND":"true","GITLAB_CI":"true","GITLAB_FEATURES":"","GITLAB_USER_EMAIL":"admin@example.com","GITLAB_USER_ID":"1","GITLAB_USER_LOGIN":"root","GITLAB_USER_NAME":"Administrator"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]} (executor_docker.go:1041:2s)
Expected behavior
Directory creation is automatic, just like Linux behavior.
Relevant logs and/or screenshots
Additional detail in linked PR
Proposal
We have confirmed with the maintainer that a PR would be welcome.
Edited by Steve Xuereb