PeaceSheep's blog PeaceSheep's blog
首页
  • 分类
  • 标签
  • 归档
相关链接
提建议&咨询&赞赏
GitHub (opens new window)

PeaceSheep

以最简洁、易懂的话解决问题
首页
  • 分类
  • 标签
  • 归档
相关链接
提建议&咨询&赞赏
GitHub (opens new window)
  • web

  • 物联网与路由器

  • 操作系统

  • 错误解决

  • 使用技巧

    • 关于MAC上PPT无法同时使用演讲者视图和放映视图(腾讯会议)的解决方案
    • 关于windows没有休眠选项(控制面板电源选项也没有)的解决方案
    • tmux简明使用教程
    • git的特殊需求使用技巧
    • containerd高版本换源,containerd换源无效问题
    • git常用操作命令
  • 教程
  • 使用技巧
PeaceSheep
2024-11-07

containerd高版本换源,containerd换源无效问题

无论是GPT 还是直接 google “contained如何换源”得到的结果都是类似于下面的回答,但这是低版本(低于v1.6.16)用的,高版本已经不适用了。用了会发现没有效果。

修改/etc/containerd/config.toml添加类似于下面东西:

[plugins]
 
    [plugins."io.containerd.grpc.v1.cri".registry]
      # config_path = "/etc/containerd/certs.d"
      config_path = ""
      
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
          endpoint = ["https://9ebf40sv.mirror.aliyuncs.com"]
1
2
3
4
5
6
7
8
9

但是这种方法对于高于v1.6.16的 contained 是无效的。新版的方法为:

同样是修改/etc/containerd/config.toml,找到[plugins.'io.containerd.cri.v1.images'.registry],把下面的config_path=''改为config_path = '/etc/containerd/certs.d'。

然后如果要配置 docker.io的镜像,就mkdir -p /etc/containerd/certs.d/docker.io,如果是别的就把docker.io换掉。

在新建出来的文件夹,新建一个文件叫做hosts.toml,内容为:

server = "https://docker.io"  # 上游地址,如果下面的都失败了就用这个。

[host."https://镜像地址 1"]
  capabilities = ["pull", "resolve"]
1
2
3
4

然后在运行sudo systemctl restart containerd和sudo systemctl daemon-reload就可以了。

编辑 (opens new window)
上次更新: 2025/06/25, 16:48:21
git的特殊需求使用技巧
git常用操作命令

← git的特殊需求使用技巧 git常用操作命令→

最近更新
01
前端概念梳理
06-26
02
愚蠢错误收集
05-29
03
ubuntu安装g++显示已有但是输入g++又找不到命令
04-15
更多文章>

Gitalking ...

Theme by Vdoing | Copyright © 2022-2025 PeaceSheep
冀ICP备2022004632号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式