Gitlab-runner + Docker + Windows-无效的卷规格

时间:2018-11-25 22:06:31

标签: docker gitlab gitlab-ci gitlab-ci-runner

我正在尝试使用Gitlab-runner和docker在本地运行我的Gitlab CI,然后再承诺确保它们可以正常工作。但是我遇到了一些奇怪的问题!

不幸的是,我别无选择,只能使用Windows(过去我在Linux上取得了成功)。

每次我在Powershell中运行作业时

C:/Gitlab-runner/gitlab-runner exec docker npm

我得到一个错误:

Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)

我尝试设置docker卷(多种组合)和builds-dir:

C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm

由于C后面的冒号,所以Error response from daemon: invalid mode: /Gitlab-runner/builds失败。

有人在我陷入困境时能指出我正确的方向吗?

使用gitlab-runner版本11.5.0

2 个答案:

答案 0 :(得分:1)

目前,Windows中尚未正式支持Docker executor。正在进行中的工作issue目前处于打开状态,似乎有些人设法让Windows docker执行程序努力工作以在合并请求中取得不同的成功。

specific comment显示了他们如何使用custom built gitlab-runner进行设置。我不确定这如何与服务一起使用,所以YMMV。

答案 1 :(得分:1)

Windows上的GitLab Runner尚未完全支持Docker。 解决方法是使用 Windows Linux子系统并在其中安装gitlab-runner:

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt-get install gitlab-runner
gitlab-runner exec docker build
相关问题