Pri*_*muS 6 gitlab gitlab-ci gitlab-ci-runner
我有一个附加服务的GitLab Runner的问题.每当作业运行时,一旦等待服务完成,它就会给我一个警告:
ContainerStart:来自守护进程的错误响应:无法链接到非运行容器:/ runner-b565e58e-project-4-concurrent-0-mysql-0 AS/runner-b565e58e-project-4-concurrent-0-mysql-0-wait - 用于业务/服务
stages:
- test
test:
stage: test
image: primus852/gitlab:latest
services:
- name: mysql:latest
command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/"]
...
Run Code Online (Sandbox Code Playgroud)
[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
...
Run Code Online (Sandbox Code Playgroud)
并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
Run Code Online (Sandbox Code Playgroud)
所以我猜这些东西有问题privileged,但是有人看到了那可能是什么吗?
您使用 覆盖服务容器,command: ["mysqld"]因此command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/"]服务容器会复制文件并在此之后停止,就像您要求的那样。
所以更改为command: ["cp tests/Files/db.sql /docker-entrypoint-initdb.d/ & mysqld"]以便在 cp 命令之后启动 mysql
| 归档时间: |
|
| 查看次数: |
2887 次 |
| 最近记录: |