1、介绍 containerd 实现了 kubernetes 的 Container Runtime Interface (CRI) 接口,提供容器运行时核心功能,如镜像管理、容器管理等,相比 dockerd 更加简单、健壮和可移植。
从docker过度还是需要一点时间慢慢习惯的,今天来探讨containerd 如何从私有仓库harbor下载镜像!
containerd 不能像docker一样 docker login harbor.example.com
登录到镜像仓库,无法从harbor拉取到镜像。
2、修改配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 cd /etc/containerd vim config.toml [plugins."io.containerd.grpc.v1.cri" .registry] config_path = "" [plugins."io.containerd.grpc.v1.cri" .registry.mirrors] [plugins."io.containerd.grpc.v1.cri" .registry.mirrors."docker.io" ] endpoint = ["https://registry.cn-hangzhou.aliyuncs.com" ] [plugins."io.containerd.grpc.v1.cri" .registry.mirrors."35.220.201.102" ] endpoint = ["http://35.220.201.102" ] [plugins."io.containerd.grpc.v1.cri" .registry.configs] [plugins."io.containerd.grpc.v1.cri" .registry.configs."35.220.201.102" .tls] insecure_skip_verify = true [plugins."io.containerd.grpc.v1.cri" .registry.configs."35.220.201.102" .auth] username = "admin" password = "harbor的密码" [root@master1 ~] 35.220.201.102 harbor
3、重启containerd服务 1 systemctl restart containerd
4、测试拉取Harbor镜像 1 2 3 [root@node ~] Image is up to date for sha256:65d9615ad919f1704881006d8de94f67e23e93173ef0edb97bad0953d72ef49b