文档首页> 编译构建 CodeArts Build> 常见问题> 制作镜像并推送到SWR仓库> 构建时拉取dockerhub镜像超时/次数限制
更新时间:2023-12-21 GMT+08:00
分享

构建时拉取dockerhub镜像超时/次数限制

问题现象

执行构建任务时,拉取dockerhub镜像超时/次数限制,日志报如下异常信息:

 Error response from daemon: Get https://registry.docker-cn.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

原因分析

可能是因为dockerhub镜像源的网络不稳定并且存在频率限制,容易导致拉取超时或失败。可以将dockerhub镜像源的镜像迁移到SWR上,再拉取镜像。

处理方法

  1. 下载dockerhub镜像源的镜像到本地。
  2. 参考页面上传镜像页面,上传镜像到SWR。
  3. 在镜像详情页面中,单击对应镜像版本“下载指令”列的复制图标,复制镜像下载指令。

  4. 修改代码仓中Dockerfile文件,将文件中镜像地址修改为步骤3中拷贝的地址。

分享:

制作镜像并推送到SWR仓库 所有常见问题

more