惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Vercel News
Vercel News
月光博客
月光博客
S
SegmentFault 最新的问题
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
小众软件
小众软件
WordPress大学
WordPress大学
G
Google Developers Blog
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 【当耐特】
I
InfoQ

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19)
拉取 Dockerhub 镜像,无法连接 Cloudflare
微信公众号 · 2021-11-12 · via 陈少文的网站

Please enable Javascript to view the contents

1. 错误提示

在拉取镜像时,偶尔会碰到如下错误:

1
2
3
4
5
6
7
8
docker pull node:10.16-alpine

10.16-alpine: Pulling from library/node
e7c96db7181b: Already exists
50958466d97a: Pulling fs layer
56174ae7ed1d: Pulling fs layer
284842a36c0d: Pulling fs layer
error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2 /docker/registry/v2/blobs/sha256/b9/b95baba1cfdbfa8b789137179d8e fff08b9768f1906725a8758cf0c431b59621/data? verify=1636603895-lbb1QIruPZBdfgfhBZ95ArGK0wU%3D: dial tcp 104.18.124.25:443: i/o timeout

2. 主要解决办法

2.1 修改 DNS 地址

如果是 CentOS ,直接修改 /etc/resolv.conf 文件,新增一行 nameserver 8.8.8.8 即可。

如果是 Ubuntu ,需要修改 /etc/systemd/resolved.conf,添加如下内容:

[Resolve]
DNS=8.8.8.8

接着执行命令 systemctl restart systemd-resolved 重启服务即可。

2.2 本地与服务器时间偏差过大

执行如下命令,进行时间同步:

1
ntpdate time.windows.com

2.3 配置镜像加速

配置镜像加速之后,如果待拉取的镜像已经存在于 mirror ,则直接从 mirror 拉取镜像层数据。

1
2
3
{
  "registry-mirrors": ["https://ustc-edu-cn.mirror.aliyuncs.com"]
}

3. 可能的原因

3.1 Cloudflare 的 IP 被禁

Dockerhub 借助 Cloudflare 的网络进行镜像的分发。在国内环境下,Cloudflare IP 的可用性得不到保障,部分 IP 被禁。

通过修改 nameserver 改变了 production.cloudflare.docker.com 指向的服务 IP 地址,切换到其他 IP 上尝试。而进行时间同步,应对的是证书无效问题,这里可能并没有效果,而只是拖延了时间,以便 DNS 指向发生变化。配置镜像加速之后,拉取镜像的 IP 会发生变化,也有可能解决问题。

3.2 Dockerhub 提升营收的策略

由于 Dockerhub 大部分都是免费的用户,难以承担巨额的带宽和存储费用,因此免费用户在可用性受损。


微信公众号