gpt4 book ai didi

Gitlab runner 无法使用来自 ~/.docker/config.json 的凭据进行身份验证

转载 作者:行者123 更新时间:2023-12-02 19:54:26 25 4
gpt4 key购买 nike

我正在尝试从 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 服务器(Ubuntu 18.04)上。
我有 3 个共享运行者,我使用 gitlab-runner register 为我在 gitlab 上的每个项目注册了一个运行者命令。
在 Gitlab 中单击“重试”之前,我正在运行 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"
}
}
}

同样前段时间给出了相同的错误并添加代理部分修复了它,直到现在返回相同的错误。

有人对此有修复建议或对此有所了解吗?

最佳答案

这可能是因为带有 executor docker 的运行器不使用 ~/.bashrc 并且没有在其中设置变量。
您必须在 Dockerfile 中设置变量并重建镜像。

要设置变量,请执行以下操作:

ENV VARIABLE



其中 VARIABLE 是您在 ~/.bashrc 中导出的内容。

如果这不起作用,请尝试 this .

关于Gitlab runner 无法使用来自 ~/.docker/config.json 的凭据进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58857700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com