出于某种原因,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...
我在这里缺少什么?
答案 0 :(得分:1)
您必须在services
的根级别定义.gitlab-ci.yml
。如docs中所示。
您的文件如下所示:
services:
- mysql:latest
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_DATABASE: el_duderino
MYSQL_ROOT_PASSWORD: mysql_strong_password
build:
stage: build
image: chilio/laravel-dusk-ci:stable
答案 1 :(得分:1)
想出来了。是由于Kubernetes执行者的性质,它的工作方式略有不同。当使用Kubernetes构建时,服务是在流道容器旁边的pod中构建的,因此运行器不会宣布它正在加载该图像。更多信息: