我正在 docker gitlab-runner 中运行 docker。我的管道工作正常,但第二天突然出现此错误
2023-08-22T12:16:21.520946073Z time="2023-08-22T12:16:21.520554728Z" level=info msg="Starting up"
2023-08-22T12:16:21.521733410Z time="2023-08-22T12:16:21.521587541Z" level=warning msg="Binding to IP address without --tlsverify is insecure and gives root access on this machine to everyone who has access to your network." host="tcp://0.0.0.0:2375"
2023-08-22T12:16:21.521765153Z time="2023-08-22T12:16:21.521610008Z" level=warning msg="Binding to an IP address, even on localhost, can also give access to scripts run in a browser. Be safe out there!" host="tcp://0.0.0.0:2375"
2023-08-22T12:16:22.522290320Z time="2023-08-22T12:16:22.521953700Z" level=warning msg="Binding to an IP address without --tlsverify is deprecated. Startup is intentionally being slowed down to show this message" host="tcp://0.0.0.0:2375"
2023-08-22T12:16:22.522367162Z time="2023-08-22T12:16:22.522079166Z" level=warning msg="Please consider generating tls certificates with client validation to prevent exposing unauthenticated root access to your network" host="tcp://0.0.0.0:2375"
2023-08-22T12:16:22.522385980Z time="2023-08-22T12:16:22.522118385Z" level=warning msg="You can override this by explicitly specifying '--tls=false' or '--tlsverify=false'" host="tcp://0.0.0.0:2375"
2023-08-22T12:16:22.522402142Z time="2023-08-22T12:16:22.522148075Z" level=warning msg="Support for listening on TCP without authentication or explicit intent to run without authentication will be removed in the next release" host="tcp://0.0.0.0:2375"
2023-08-22T12:16:37.535125199Z time="2023-08-22T12:16:37.534854215Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
2023-08-22T12:16:37.538601295Z failed to load listeners: can't create unix socket /var/run/docker.sock: device or resource busy
这是我的 gitlab-runner config.toml
concurrent = 5
check_interval = 0
shutdown_timeout = 0
log_level = "trace"
[session_server]
session_timeout = 1800
[[runners]]
name = "Awesome Docker Runner"
url = "https://gitlab-site/"
id = 10855
token = "some token"
token_obtained_at = 2022-01-24T07:07:59Z
token_expires_at = some-date
executor = "docker"
[runners.docker]
tls_verify = false
image = "muycustome-docker-runner"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = [
"/cache",
"/opt/.docker/config.json:/root/.docker/config.json:ro",
"/var/run/docker.sock:/var/run/docker.sock"
]
extra_hosts = ["cache-registry.io:Ip-for-registery"]
pull_policy = ["always"]
shm_size = 0
在 gitlab-ci.yml 上偷看高峰
stages:
- build
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
IMAGE_HOST: cache-registry.io
services:
- name: muycustome-docker-runner
alias: docker
default:
tags:
- dind
image: muycustome-docker-runner
before_script:
- docker info
我已经尝试了一些方法,但仍然不起作用。
gitlab-runner 尝试创建 sock 文件并发现它已经存在 停止泊坞窗 删除 docker.sock 文件: rm -f /var/run/docker.sock 然后再试一次