无法在 Windows 服务器上使用 docker 为 gitlab-ci 运行构建
Posted
技术标签:
【中文标题】无法在 Windows 服务器上使用 docker 为 gitlab-ci 运行构建【英文标题】:Unable to run build for gitlab-ci using docker on windows server 【发布时间】:2016-03-25 05:54:05 【问题描述】:我正在尝试为 dotnet 4.6 项目设置 CI。 我将 GitLab v8.5.1 与共享运行器 v1.0.4 一起使用。
我已经安装了一个支持 docker 的 Windows Server 2016 CTP 4,并基于 microsoft windowsservercore 映像为 gitlab ci runner 创建了一个映像。
有我的.toml
concurrent = 1
[[runners]]
name = "docker runner 1"
url = "http://my_server/ci"
token = "my_token"
tls-ca-file = ""
executor = "docker"
builds_dir="c:\builds"
[runners.docker]
image = "windowsservercoregitlab:latest"
host = "tcp://127.0.0.1:2375"
privileged = false
和.yaml
文件
阶段: - 构建
job:
stage: build
script:
- echo "Test run my build..."
当我运行构建失败并显示日志:
gitlab-ci-multi-runner 1.0.4 (014aa8c)
Using Docker executor with image windowsservercoregitlab:latest ...
ERROR: Build failed with: API error (500): hcsshim::ImportLayer - Win32 API call returned error r1=2147942402 err=The system cannot find the file specified. layerId=c1ef764e74b9a93262141455f30229877e80ed9c04b93af6bc73e03568c33790 flavour=1 folder=C:\ProgramData\docker\windowsfilter\c1ef764e74b9a93262141455f30229877e80ed9c04b93af6bc73e03568c33790-1950806090
显然,它试图创建一些卷并失败,但我无法理解哪个卷或如何正确设置它。
我该如何解决这个问题?
【问题讨论】:
【参考方案1】:正如我从他们最喜欢的recent Webcast 中回忆的那样。目前 Windows 运行器仅支持“Shell”,而 docker 用于 Linux/Unix 系统(不确定 Mac)。话虽如此,我使用 shell 执行器没有问题。
【讨论】:
以上是关于无法在 Windows 服务器上使用 docker 为 gitlab-ci 运行构建的主要内容,如果未能解决你的问题,请参考以下文章
无法从 docker 容器连接到 Localhost Mysql
Jenkins 在 Windows 上使用 Docker - 无法运行程序“nohup”
无法在 Windows 10 上使用 docker 访问 localhost:8080
用于 php 的 docker 映像无法在 Windows 10 的浏览器上运行