出于某种原因,Gitlab中的Gitlab Runner没有拉动或使用我在gitlab-ci.yml中定义为服务的图像 . 我在本地安装了gitlab-runner,一切正常,但是当我推送到Gitlab时,它不起作用 . 我在这里失去它 .
gitlab-ci.yml:
build:
stage: build
services:
- mysql
image: chilio/laravel-dusk-ci:stable
来自Gitlab的输出,仅使用 image
,而不是 services
定义的图像:
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on gitlab-runner-gitlab-runner-3695154600-vj3bh (8620b628)
Using Kubernetes namespace: default
Using Kubernetes executor with image chilio/laravel-dusk-ci:stable ...
Waiting for pod default/runner-8620b628-project-1-concurrent-0jqbbv to be running, status is Pending
Running on runner-8620b628-project-1-concurrent-0jqbbv via gitlab-runner-gitlab-runner-3695154600-vj3bh...
Cloning repository...
从我的本地机器输出,同时拉动:
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on ()
Using Docker executor with image chilio/laravel-dusk-ci:stable ...
Starting service mysql:latest ...
Pulling docker image mysql:latest ...
Using docker image mysql:latest ID=sha256:f0f3956a9dd825e3195f0d1a4fe17cc94b0f6934fc470b09abf8fad87d17ff24 for mysql service...
Waiting for services to be up and running...
Using docker image sha256:64cbb31659359752dd4fb4580047faf5b0ec487258d09ca8a97897a0ba615d1b for predefined container...
Pulling docker image chilio/laravel-dusk-ci:stable ...
Using docker image chilio/laravel-dusk-ci:stable ID=sha256:a07a953be1b12bc294b5bbdb229fe7312c2916b7ad3397ff970b8145165e36e7 for build container...
Running on runner--project-0-concurrent-0 via mchale...
我在这里错过了什么?
2 回答
您必须在
.gitlab-ci.yml
的根级别定义services
. 如docs所示 .你的文件看起来像这样:
想出这个 . 是由于Kubernetes执行者的性质,它的工作方式略有不同 . 当使用Kubernetes构建时,服务是在流道容器旁边的pod中构建的,因此运行器不会宣布它正在加载该图像 . 更多信息:
More info