我试图从gitlab CI/CD运行一个项目,并得到以下错误:
on Gitlab-runner-1 M--MHsVp
Using Docker executor with image registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable ...
Starting service docker:stable-dind ...
Authenticating with credentials from /home/Pq515devops/.docker/config.json
Pulling docker image docker:stable-dind ...
Using docker image sha256:eaed9efc02d231a28b0f7725551a71459a7763e83bcda5464db66ec4684a1639 for docker:stable-dind ...
Waiting for services to be up and running...
*** WARNING: Service runner-M--MHsVp-project-3187-concurrent-0-docker-0 probably didn't start properly.
Health check error:
ContainerStart: Error response from daemon: Cannot link to a non running container: /runner-M--MHsVp-project-3187-concurrent-0-docker-0 AS /runner-M--MHsVp-project-3187-concurrent-0-docker-0-wait-for-service/service (executor_docker.go:1254:0s)
Service container logs:
2019-11-14T12:48:10.698686600Z mount: permission denied (are you root?)
2019-11-14T12:48:10.700536600Z Could not mount /sys/kernel/security.
2019-11-14T12:48:10.700550600Z AppArmor detection and --privileged mode might break.
2019-11-14T12:48:10.703434000Z mount: permission denied (are you root?)
*********
Pulling docker image registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable ...
Using docker image sha256:c114dffc16419102b42958970133bc5950c85961747ba2ed9d37741457d829df for registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable ...
Authenticating with credentials from /home/Pq515devops/.docker/config.json
Running on runner-M--MHsVp-project-3187-concurrent-0 via Gitlab-runner-1...
Authenticating with credentials from /home/Pq515devops/.docker/config.json
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/bsmchstudents/whitesmokerph36/.git/
Created fresh repository.
remote: You are not allowed to download code from this project.
fatal: unable to access 'http://gitlab-ci-token:[MASKED]@gitlab.it.bsmch.net/bsmchstudents/whitesmokerph36.git/': The requested URL returned error: 403
Authenticating with credentials from /home/Pq515devops/.docker/config.json
ERROR: Job failed: exit code 1
我试着运行其他项目,它们都以ERROR: Job failed: exit code 1
错误结束。我试着在网上寻找一个解决方案,似乎这个错误没有一个原因,而且我尝试了一些发现有用的东西,尽管没有什么改变,例如,我看到的一个解决方案是将unset cd
添加到./bashrc中,它没有改变任何东西。Gitlab-runner和docker都安装在gitlab runner服务器上(Ubuntu18.04)。我有3个共享运行程序,我使用gitlab-runner register
命令为我在gitlab上的每个项目注册了一个运行程序。在Gitlab中单击"Retry“之前,我正在运行gitlab-runner run
命令,它检查来自所有运行程序的作业,一旦找到它就加载它,然后过一段时间发送如下:WARNING: Job failed: exit code 1 duration=13.6350221s job=19551 project=3187 runner=M--MHsVp WARNING: Failed to process runner builds=0 error=exit code 1 executor=docker runner=M--MHsVp
。
我认为这可能与/home/Pq515devops/.docker/config.json
文件有关:
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "*****"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.7 (linux)"
},
"proxies": {
"default": {
"httpProxy": "http://10.0.0.10.80",
"httpsProxy": "http://10.0.0.10:80"
}
}
}
也是在一段时间前,给出了相同的错误,添加代理部分修复了它,直到现在相同的错误返回。
有人对此有建议或对此有所了解吗?
发布于 2020-01-17 18:46:22
这可能是因为带执行器停靠器的运行程序没有使用~/..bashrc,也没有在其中设置变量。您必须在您的Dockerfile中设置变量并重建您的映像。
若要设置变量,请执行以下操作:
ENV变量
其中变量是在~/..bashrc中导出的内容。
如果这不起作用,可以试试这。
https://stackoverflow.com/questions/58857700
复制相似问题