我有一个在docker容器中运行的gitlab实例。现在,我想在同一主机上设置gitlab-runner。两者都在运行:

docker container ls
CONTAINER ID        IMAGE                         COMMAND                  CREATED              STATUS                 PORTS                                                            NAMES
279473dceb2f        gitlab/gitlab-runner:alpine   "/usr/bin/dumb-ini..."   About a minute ago   Up About a minute                                                                       gitlab-runner
6d7af0d6b946        gitlab/gitlab-ce:latest       "/assets/wrapper"        2 hours ago          Up 2 hours (healthy)   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8022->22/tcp   gitlab


我将docker映像注册为共享运行器:

concurrent = 1
check_interval = 0

[[runners]]
  name = "default shared maven runner"
  url = "http://url-of-my-gitlab.instance"
  token = "valid token"
  executor = "docker"
  [runners.docker]
    pull_policy = "never"
    tls_verify = false
    image = "maven-java-8:latest"
    privileged = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
  [runners.cache]


已注册图像maven-java-8是具有正确settings.xml的自定义图像,并且已在docker images中列出。 >我解释这是因为它试图使用gitlab-runner容器内部的本地图像。 />
.gitlab-cy.yml的内容是:

Running with gitlab-ci-multi-runner 9.3.0 (3df822b)
  on Maven Test (5b2573e4)
Using Docker executor with image maven-java-8 ...
Using docker image  sha256:c266311d78b33f89f6eecce00f19a0428e37ba6af6734c8fced32fa11e4bd4ba for predefined container...
Pulling docker image maven-java-8 ...
ERROR: Job failed: Error response from daemon: repository maven-java-8 not found: does not exist or no pull access


我缺少什么?

#1 楼

管理摘要

通过调用以下命令在pull_policy部分中将"never"设置为[runners.docker]:似乎问题出在图像和装入的卷的混乱上。

文档说在以下位置配置运行器:

docker exec -it gitlab-runner \
  vi /etc/gitlab-runner/config.toml


我做了,但是
在docker容器中运行gitlab-runner时,它会挂载一个卷:容器已安装到主机上的/etc/...