Gitlab-runner + Docker + Windows - 卷规格无效 [英] Gitlab-runner + Docker + Windows - Invalid volume specification
问题描述
我正在尝试在提交之前使用 Gitlab-runner 和 docker 在本地运行我的 Gitlab CI,以确保它们正常工作.但是我遇到了一些奇怪的问题!
I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!
不幸的是,我别无选择,只能使用 windows(我过去在 Linux 上取得过成功).
Unfortunately I have no choice but to use windows (I've had success in the past on Linux).
每次我在 powershell 中运行作业时:
Every time I run a job in powershell:
C:/Gitlab-runner/gitlab-runner exec docker npm
我收到一个错误:
作业失败(系统故障):来自守护程序的错误响应:无效卷规范:'/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)
我尝试设置 docker 卷(多种组合)和 builds-dir:
I've tried setting docker volumes (nemerous combinations) and builds-dir:
C:/Gitlab-runner/gitlab-runner exec docker --builds-dir/builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm代码>
Error response from daemon: invalid mode:/Gitlab-runner/builds
失败,因为 C.. 后有冒号
That fails with Error response from daemon: invalid mode: /Gitlab-runner/builds
because of the colon after the C..
当我被难住时,谁能指出我正确的方向?
Can anyone point me in the right direction as I'm stumped?
使用 gitlab-runner 版本 11.5.0
Using gitlab-runner version 11.5.0
推荐答案
目前 Windows 中的 Docker 执行器没有官方支持.一个正在进行的工作 issue 目前是开放的,看起来就像有些人设法让 Windows docker 执行器在该合并请求中取得不同程度的成功.
At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.
这个具体评论展示了他们是如何管理的使用 自定义构建gitlab 运行器.但是,我不确定这将如何与服务一起使用,所以 YMMV.
This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.
这篇关于Gitlab-runner + Docker + Windows - 卷规格无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!