Libelektra: Docker:已达到拉取速率限制。

创建于 2020-12-01  ·  18评论  ·  资料来源: ElektraInitiative/libelektra

Docker 最近对匿名和免费用户实施了拉取率限制。 限制为每六小时 100(匿名)和 200(免费)容器镜像拉取请求。

由于此限制,构建开始失败,我们需要实施修复或解决方法。

docker build -t hub.libelektra.org/build-elektra-alpine:202012-0e6d95bb97e68999c969280c59562b159b8a0ecbee2a5aba451fe640081032de --pull --build-arg JENKINS_GROUPID=47110 --build-arg JENKINS_USERID=47110 --build-arg PARALLEL=12 --build-arg BASE_IMG=hub.libelektra.org/build-elektra-web-base:master_299 -f ./scripts/docker/alpine/3.12/Dockerfile ./scripts/docker/alpine/3.12
Sending build context to Docker daemon  6.144kB

Step 1/7 : FROM alpine:3.12.1
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
script returned exit code 1
continuous integration

最有用的评论

如果它只有 14 个 docker 图像并且我们每月只提取一次,我们应该远低于任何限制吗?

Jenkins 管道似乎一直在运行一项工作(我认为是网站),该工作一直试图从 Docker Hub 中提取: https :

AFAIK 这是因为使用了build --pull

我们可能应该默认使用build (没有--pull )并每周或每月使用--pull运行它。

所有18条评论

我们的构建服务器实际上应该只从我们的私有 docker 注册表中提取,而不是从 docker.org 中提取。

问题可能只是我们没有在 hub.libelektra.org 上更改的设置吗? 或者有没有在 hub.libelektra.org 上镜像的图像?

@robaerd你能看看吗? 这是紧急的,因为它会影响我们的构建。

或者有没有在 hub.libelektra.org 上镜像的图像?

它似乎总是检查不在我们集线器上的更新的基本图像......

它似乎总是检查不在我们集线器上的更新的基本图像......

这是 docker 镜像每月重建的一部分,因为月份是镜像 id 的一部分。

docker 映像当前已再次缓存,因此不应重建 docker 映像,因此该错误至少在本月不会再次发生。

我仍然不确定如何使用我们的 ~14 个 docker 图像超过 100 个拉取限制。

谢谢你的调查。 :sparkling_heart: 是的,它看起来有点奇怪:如果只有 14 个 docker 图像并且我们每月只拉取一次,我们应该远低于任何限制吗?

它似乎总是检查不在我们集线器上的更新的基本图像......

hub.libelektra.org 是否像这样配置: https ://docs.docker.com/registry/recipes/mirror? 如果是这样,我的理解是检查图像是否是最新的应该只计入配额,如果它真的需要拉一个新的图像。

解决配额的最简单方法是为 CI 创建一个 Docker Hub 帐户。 有一个开源计划,所以我们可能有资格获得一个无限制的帐户。

如果有帮助,我可以申请。 但首先我们应该找出问题所在。

我不知道 Docker Hub 如何跟踪速率限制。 我假设它是基于 IP 的,否则在本地重置太容易了。 在这种情况下,我们的构建服务器是唯一会通过这个 IP 显示给 Docker Hub 的东西吗?

是的,构建服务器有一个专用IP,甚至几个,而且CI是唯一使用docker的部分。

如果它只有 14 个 docker 图像并且我们每月只提取一次,我们应该远低于任何限制吗?

Jenkins 管道似乎一直在运行一项工作(我认为是网站),该工作一直试图从 Docker Hub 中提取: https :

AFAIK 这是因为使用了build --pull

我们可能应该默认使用build (没有--pull )并每周或每月使用--pull运行它。

感谢您发现! :sparkling_heart:

感谢您找到此问题的原因!

除了删除--pull ,我们还可以在尚未安装 elektra 的情况下为 webui 基础创建一个基础映像(仅安装了依赖项和 gtests)。 这个基础镜像将像其他镜像一样每月构建一次,webui 基础镜像将从这个基础镜像扩展,并且只从我们的私有 docker 注册表中拉取(因此不会影响拉取限制)

尚未安装 elektra 的 webui 基础

我喜欢这个主意! 不管 Docker 拉取限制如何,这都将是一个改进!

尚未安装 elektra 的 webui 基础

是的,这也是一种选择。 有问题的图像已经是实际webuielektrad图像的基础图像。 所以我们可以将 Elektra 的复制和构建移动到其他 Dockerfile 中。 或者也许有一个多阶段构建的解决方案? 不确定,是否可以将中间阶段推入/拉出注册表。

昨天我在 jenkins 上测试共享库,其中执行了 pull-stage。 没有镜像构建,只从我们在 hub.libelektra.org 上的私有 docker 注册表中提取,我仍然收到 Docker Rate Limit 错误。 我看得更深一些,并设法找到了我们问题的原因。
它是watchtower ,一个运行的容器,它以指定的时间间隔更新我们的图像。 这个问题应该在他们的最新版本中修复。 我将更新此图像并将轮询间隔设置为更高的值。
瞭望塔集装箱的日志也证实了我的假设。

time="2020-11-16T22:22:58Z" level=info msg="Unable to update container /frontend_repo_1, err='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'. Proceeding to next."
time="2020-11-16T22:22:59Z" level=info msg="Unable to update container /frontend_registry_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:00Z" level=info msg="Unable to update container /frontend_letsencrypt-nginx-proxy-companion_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:01Z" level=info msg="Unable to update container /frontend_nginx-proxy_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:02Z" level=info msg="Unable to update container /frontend_watchtower_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:04Z" level=info msg="Unable to update container /frontend_libelektra-webui_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:28Z" level=info msg="Unable to update container /frontend_repo_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:29Z" level=info msg="Unable to update container /frontend_registry_1, err='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'. Proceeding to next."
time="2020-11-16T22:23:30Z" level=info msg="Unable to update container /frontend_letsencrypt-nginx-proxy-companion_1, err='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'. Proceeding to next."

非常感谢您发现 :sparkling_heart:

@robaerd我们可以关闭这个还是有其他事情要做?

在工件阶段(webui、网站、包测试)中使用的所有 docker 图像仍然从 docker.org 而不是我们的私有注册表中提取。 我认为这可能应该是一个单独的问题,因为我们永远不会超过 docker pull-limit。 但由于瞭望塔图像更新,这个问题应该得到修复,恕我直言可以关闭。

可能没有其他事情需要做。 如果我们没有达到限制,从 docker.org 拉取恕我直言是可以的。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

e1528532 picture e1528532  ·  4评论

markus2330 picture markus2330  ·  4评论

mpranj picture mpranj  ·  3评论

mpranj picture mpranj  ·  3评论

mpranj picture mpranj  ·  3评论