为什么我的 gitlab-runner(在 Docker 容器中)失败了几天,我没有改变任何东西



我有一台Ubuntu 18.04服务器。在该服务器上,在docker容器中运行gitlab ce 12.7.5实例,在dockercontainer中运行gitlab runner 12.8.0。几天以来,所有的管道都出现了故障:

*Running with gitlab-runner 12.8.0 (1b659122)
on ddddd kbuTsA6j
Using Docker executor with image ubuntu:18.04 ...
00:02
Pulling docker image ubuntu:18.04 ...
Using docker image sha256:2c047404e52d7f17bdac4121a13cd844447b74e13063f8cb8f8b314467feed06 for ubuntu:18.04 ...
ERROR: Job failed (system failure): Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: process_linux.go:422: setting cgroup config for procHooks process caused: resulting devices cgroup doesn't match target mode: unknown (executor_docker.go:810:0s)*

gitlab runner容器的config.toml文件如下所示:

concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "ddddd"
url = "https://myreplacedname.stratoserver.net:8929/"
token = "kbuTsA6jgE_GrM"
tls-ca-file = "/etc/gitlab-runner/certs/myreplacedname.stratoserver.net.crt"
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.docker]
tls_verify = false
image = "docker:19.03.1"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/srv/gitlab-runner/config:/etc/gitlab-runner", "/cache", "/builds:/builds"]
shm_size = 0

直到几天前,一切都很顺利。如果你能帮助我,我将非常高兴。谢谢!

我花了几天时间试图找到同一问题的解决方案。我发现将值false分配给[runners.docker]部分的privileged字段可以解决这个问题。

因此,在您的情况下,得到的配置将如下所示:

concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "ddddd"
url = "https://myreplacedname.stratoserver.net:8929/"
token = "kbuTsA6jgE_GrM"
tls-ca-file = "/etc/gitlab-runner/certs/myreplacedname.stratoserver.net.crt"
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.docker]
tls_verify = false
image = "docker:19.03.1"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/srv/gitlab-runner/config:/etc/gitlab-runner", "/cache", "/builds:/builds"]
shm_size = 0

当然,要应用这些更改,必须在执行这些操作后重新启动gitlab runner实例。我希望它也能帮助你。

相关内容

  • 没有找到相关文章

最新更新