如何在 Ubuntu 上使用 Drone CI 向 Dockerhub 进行身份验证?

Mid*_*ene 5 authorization docker drone.io dockerhub

自 11 月 2 日起,Dockerhub 对其注册表中的拉取实施限制。我的 Drone CI 发布(到私有注册表)失败,因为它基于 openjdk:14-jdk-alpine,必须从注册表中提取。

所以我在https://hub.docker.com/上创建了一个帐户并配置了 config.json 如下

我的 /root/.docker/config.json 看起来像这样

{
    "auths": {
            "https://index.docker.io/v1/": {
                    "auth": "my-api-key-is-here"
            }
    },
    "HttpHeaders": {
            "User-Agent": "Docker-Client/19.03.13 (linux)"
    }
Run Code Online (Sandbox Code Playgroud)

}

所以我正在运行以下容器:

drone/drone:latest
drone/drone-runner-docker:latest
Run Code Online (Sandbox Code Playgroud)

其中 Drone-runner-docker 有一个绑定到 docker sock 主机的卷 (/var/run/docker.sock)

运行构建和发布时,我收到下面的 ToomanyRequests 错误。

toomanyrequests: You have reached your pull rate limit. You may increase the limit by 
authenticating and upgrading: https://www.docker.com/increase-rate-limit
time="2020-11-20T22:50:14Z" level=fatal msg="exit status 1"
Run Code Online (Sandbox Code Playgroud)

显然我仍处于访客模式,我做错了什么?

latest: Pulling from plugins/docker
Digest: 
sha256:60f36379eb3f1b27a61f7c0a275dd260387a00af1144345976475b2a35e5ee4f
Status: Image is up to date for plugins/docker:latest
+ /usr/local/bin/dockerd --data-root /var/lib/docker -- 
host=unix:///var/run/docker.sock
Registry credentials or Docker config not provided. Guest mode enabled.
Run Code Online (Sandbox Code Playgroud)