当我在自己的Gitlab CI Runner“myrunner”上运行此任务时。
如何在拉取Dockerhub的docker:dind镜像时进行身份验证以避免拉取速率限制?
创建自己的Gitlab runner步骤:
启动runner:
test:
tags:
- myrunner
image: docker:latest
stage: build
services:
- docker:dind
script:
- echo "It works!"
rules:
- when: always
我收到了这个错误信息:
Preparing the "docker" executor
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
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:1s)
Will be retried in 3s ...
如何在拉取Dockerhub的docker:dind镜像时进行身份验证以避免拉取速率限制?
创建自己的Gitlab runner步骤:
启动runner:
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
注册:
docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
--non-interactive \
--executor "docker" \
--docker-image docker:stable \
--url "DOMAIN" \
--registration-token "REGISTRATION_TOKEN" \
--description "docker-runner" \
--tag-list "myrunner" \
--run-untagged="true" \
--locked="false" \
--access-level="not_protected" \
--docker-volumes "/certs/client" \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock \
--docker-privileged
config.toml
中将DOCKER_AUTH_CONFIG
作为环境变量传递。抱歉,我没有在我的端上测试过。 - Nicolas Pepinster