简体   繁体   English

GitLab Runner没有运行特权

[英]GitLab Runner not running privileged

I have an issue with a GitLab Runner that has a service attached. 我有一个附加服务的GitLab Runner的问题。 Whenever the job is run, as soon as waiting for the service is completed, it gives me a warning: 每当作业运行时,一旦等待服务完成,它就会给我一个警告:

ContainerStart: Error response from daemon: Cannot link to a non running container: /runner-b565e58e-project-4-concurrent-0-mysql-0 AS /runner-b565e58e-project-4-concurrent-0-mysql-0-wait-for-service/service ContainerStart:来自守护进程的错误响应:无法链接到非运行容器:/ runner-b565e58e-project-4-concurrent-0-mysql-0 AS / runner-b565e58e-project-4-concurrent-0-mysql-0-wait - 用于业务/服务

gitlab-ci.yml gitlab-ci.yml

stages:
  - test

test:
  stage: test
  image: primus852/gitlab:latest
  services:
    - name: mysql:latest
      command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/"]
...

config.toml config.toml

[runners.docker]
    tls_verify = false
    image = "php:fpm-alpine"
    privileged = true
    disable_cache = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock","/cache"]
    shm_size = 0
...

And the gitlab-runner is started with this: gitlab-runner以这个开头:

sudo docker run -d --name gitlab-runner --privileged --restart always   -v /var/run/docker.sock:/var/run/docker.sock   -v /srv/gitlab-runner/config:/etc/gitlab-runner   gitlab/gitlab-runner:latest

So I guess something is wrong with the privileged stuff, but does anybody see what that may be? 所以我觉得privileged东西有问题,但是有人看到了那可能是什么吗?

you overwrite the service container command: ["mysqld"] with command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/"] , so the service container copies the files and stops after that, like you asked it to do. 你用command: ["mysqld"]覆盖服务容器command: ["mysqld"] command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/"] ,所以服务容器复制文件并在那之后停止,就像你问它要做。

so change to command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/ & mysqld"] in order to start mysql after the cp-command 所以更改为command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/ & mysqld"]以便在cp-command之后启动mysql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM