CI作业使用docker:dind映像作为特定构建的服务。但是,在执行过程中出现错误
.gitlab-ci.yml:
image: tmaier/docker-compose:latest
services:
- docker:18.09.7-dind
variables:
DOCKER_DRIVER: overlay2
stages:
- test
- build
- push
- clean-up
before_script:
- docker info
- apk update
- apk add make
- make down
test:
stage: test
tags: [test]
image: tiangolo/docker-with-compose:latest
script:
- make prod-up
- make composer-init-dev
- make test
config.toml:
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "My Docker Runner"
url = "https://###/"
token = "FRft8kukkz3qwXw6kkFJ"
executor = "docker"
pre_clone_script = "git config --global http.sslVerify false"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "tiangolo/docker-with-compose"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
Insecure = false
[runners.cache.s3]
[runners.cache.gcs]
错误:
服务器: 错误:无法通过tcp:// docker:2375连接到Docker守护程序。泊坞窗守护程序正在运行吗? 错误漂亮的打印信息 错误:作业失败:退出代码1
有关此问题https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26727的所有信息
答案 0 :(得分:0)
万一有人偶然发现了这个问题,又不想阅读评论和问题编辑来找到问题的解决方案,则:
在OP的原始CI配置中,声明了两个docker-in-docker服务:
docker:18.09.7-dind
docker:dind
似乎他们互相干扰,并且当OP删除特定于工作的作业时,一切都开始起作用。