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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
B
Blog RSS Feed
A
About on SuperTechFans
V
Visual Studio Blog
J
Java Code Geeks
U
Unit 42
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
M
MIT News - Artificial intelligence
IT之家
IT之家
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
C
Check Point Blog
博客园 - 叶小钗
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
B
Blog
S
SegmentFault 最新的问题
Microsoft Azure Blog
Microsoft Azure Blog

DevOps

复制企业级 Linux 开发环境:如何实现严格开发环境与生产环境一致性的基础架构策略 带有账密的 ISP 住宅代理,海外服务器请求正常, macOS 本地 curl 持续失败 A lock-file-based plugin manager for Jenkins 从 2022 年至今, DevOps 技术栈有什么新的发展吗 oracle 1U1G 机器能吗? 各位都是怎样优雅的 pull 容器镜像的 Gisia 新版发布,增加看板功能,欢迎提意见 内部做一个新的环境,在更新生产环境前先把生产服务等先在这个服务上过一遍,确认没问题后再上生产,这个环境叫什么环境?这种流程叫什么流程? 一个 Jenkins 技术问题,要被搞疯了 推荐一款轻量级 DevOps 平台 tg 上运维/sre/devops 相关的交流群 有哪些能满足要求的 DevOps 平台? 国内参加 CKA/CKAD 考试有无推荐的代理提供商 关于 Java 项目的健康检查、自愈和轻量级管理 drone 构建一直卡住,心力憔悴 [Terraform/腾讯云] 有用 Terraform 来管理腾讯云的朋友吗,它这个频率限制真的没问题吗? 遇到一点证书问题,望运维大佬给看看 关于 CMDB 如何保证数据一致性的讨论 Red Hat Access 文档下载求助 各位 Linux 运维的巨佬工作用 mac 吗 在单服务器搭最小规模的 CICD 的技术栈是什么 遇到一个 Redis 跨 VPC 读取的问题 好奇 Linux 运维 修改配置一般有做版本控制吗 私有化 SaaS 系统应该支持随便换域名吗 请教一个关于容器化部署的问题 官方 helm charts V.S. bitnami helm charts V.S. 官方 operator,大家一般倾向于用哪个? terraform 原理的一点儿思考 私有化部署太难搞了 Google SRE 的 on-call 方法和工具 开发转做运维开发,有什么需要注意的?需要额外学习和掌握什么?
使用 containerd 配置镜像加速不生效问题
isxzlhhh · 2025-08-29 · via DevOps

问题:由于国内 docker.io 镜像仓库关闭了,所以想配置镜像加速,但是配置好像一直没有生效,还是从官方仓库拉取镜像
containerd version:ctr github.com/containerd/containerd v1.7.27
containerd config:
version = 2
root = "/var/lib/containerd"
state = "/run/containerd"
oom_score = 0
[grpc]
address = "/run/containerd/containerd.sock"
uid = 0
gid = 0
max_recv_message_size = 16777216
max_send_message_size = 16777216
[debug]
address = "/run/containerd/containerd-debug.sock"
uid = 0
gid = 0
level = "warn"
[timeouts]
"io.containerd.timeout.shim.cleanup" = "5s"
"io.containerd.timeout.shim.load" = "5s"
"io.containerd.timeout.shim.shutdown" = "3s"
"io.containerd.timeout.task.state" = "2s"
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "sealos.hub:5000/pause:3.9"
max_container_log_line_size = 16384
max_concurrent_downloads = 20
disable_apparmor = true
[plugins."io.containerd.grpc.v1.cri".containerd]
snapshotter = "overlayfs"
default_runtime_name = "runc"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.crun]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.crun.options]
BinaryName = "/usr/bin/crun"
SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
certs.d 目录下有三个目录( docker.io registry.k8s.io sealos.hub:5000 ),每个目录各自配置了 hosts.toml
docker.io->hosts.toml
server = "https://docker.io"
[host."https://docker.1ms.run"]
capabilities = ["pull", "resolve"]
[host."https://docker.m.daocloud.io"]
capabilities = ["pull", "resolve"]
[host."https://dockerproxy.com"]
capabilities = ["pull", "resolve"]
registry.k8s.io->hosts.toml
server = "registry.k8s.io"
[host."k8s.m.daocloud.io"]
capabilities = ["pull", "resolve"]
使用 ctr 拉取镜像,还是拉取不了
root@localhost:/etc/containerd/certs.d/registry.k8s.io# ctr --debug images pull docker.io/library/nginx:latest
DEBU[0000] fetching image="docker.io/library/nginx:latest"
DEBU[0000] resolving host=registry-1.docker.io
DEBU[0000] do request host=registry-1.docker.io request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=containerd/v1.7.27 request.method=HEAD url="https://registry-1.docker.io/v2/library/nginx/manifests/latest"
INFO[0030] trying next host error="failed to do request: Head \"https://registry-1.docker.io/v2/library/nginx/manifests/latest\": dial tcp 118.193.240.41:443: i/o timeout" host=registry-1.docker.io
ctr: failed to resolve reference "docker.io/library/nginx:latest": failed to do request: Head "https://registry-1.docker.io/v2/library/nginx/manifests/latest": dial tcp 118.193.240.41:443: i/o timeout
但是还有个奇怪的问题就是 使用 crictl 拉取镜像是能够正常拉取的
root@localhost:/etc/containerd/certs.d/registry.k8s.io# crictl pull nginx:latest
Image is up to date for sha256:47ef8710c9f5a9276b3e347e3ab71ee44c8483e20f8636380ae2737ef4c27758
这个问题困扰小弟很久了,跪求各位大佬帮忙看看是啥问题