5

给 containerd 配置 registry mirrors

 1 year ago
source link: https://blog.shuf.io/post/config-registry-mirrors-for-containerd
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Feb 01, 2023

给 containerd 配置 registry mirrors

今天给 containerd 配置 registry mirror,发现旧的配置格式已经失效了,例如:

version = 2
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["http://local-registry-mirror"]

最新的 containerd (v1.6.16) 已经修改为类似 docker 的配置方式,具体可以参考 containerd 仓库的 readme

[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"

相对应的 registry 的镜像配置就在 /etc/containerd/certs.d/ 下创建对应的 registry 目录(例如:docker.io),并把配置写到目录下的 hosts.toml 文件中。下面是 docker.io 的镜像仓库的配置 /etc/containerd/certs.d/docker.io/hosts.toml

server = "https://registry-1.docker.io"
host."http://cache.prod.infra.pek.home.lab:5000".capabilities = ["pull", "resolve"]

Some rights reserved

Except where otherwise noted, content on this page is licensed under a Creative Commons Attribution-NonCommercial 4.0 International license.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK