我已经订阅了 Pro 计划docker https://www.docker.com/pricing帐户到提高速率限制 https://www.docker.com/increase-rate-limit在我自己托管的 Gitlab CI 工作中。然后在服务器上使用以下命令成功登录:
$ sudo docker login -u user -p *******
这是我的.gitlab-ci.yml
file:
image: edbizarro/gitlab-ci-pipeline-php:7.3-alpine
unittest:
stage: testing
services:
- mysql:latest
script:
- ./vendor/bin/phpunit --colors --stop-on-failure
但是当工作开始时,我仍然收到此错误:
Running with gitlab-runner 13.6.0 (8fa89735)
on fafa-group-runner n7oiBzAk
Preparing the "docker" executor
30:53
Using Docker executor with image edbizarro/gitlab-ci-pipeline-php:7.3-alpine ...
Starting service mysql:latest ...
Pulling docker image mysql:latest ...
ERROR: Preparation failed: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit (docker.go:142:4s)
我错过了什么吗?
您以 root 用户身份在主机上执行了 docker 登录。然而,图像是由 GitLab 运行程序拉取的,该运行程序将是另一个用户,可能是容器化的。
The 配置运行者注册表凭据的说明 https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#define-an-image-from-a-private-container-registry有几个选项,包括设置DOCKER_AUTH_CONFIG
在项目的任一.gitlab-ci.yml
或跑步者的config.toml
。该变量包含的内容~/.docker/config.json
里面有注册表凭据。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)