gpt4 book ai didi

docker - Gitlab Runner没有提取在gitlab-ci.yml中定义为服务的图像

转载 作者:行者123 更新时间:2023-12-02 19:06:58 24 4
gpt4 key购买 nike

由于某些原因,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...

我在这里想念什么?

最佳答案

您必须在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

关于docker - Gitlab Runner没有提取在gitlab-ci.yml中定义为服务的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48932434/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com