k8s中 docker和containerd 镜像相互导入导出

containerd镜像导出并导入docker

1 查看containerd 本地镜像列表

复制代码
crictl images 

2 containerd 导出本地镜像到当前目录下(注意: 导出导入需要指定镜像平台类型 --platform

复制代码
ctr -n k8s.io images export nacos-server-24-06-30-13-02-02.tar  docker.io/nacos/nacos-server:v2.1.2  --platform linux/amd64

3 将当前目录下tar 复制到远程docker主机下

复制代码
scp nacos-server-24-06-30-13-02-02.tar root@101.133.22.13:~ 

4 docker 加载tar镜像包

复制代码
docker load -i nacos-server-24-06-30-13-02-02.tar 

docker 镜像导出并导入containerd

1 docker保存镜像为tar文件

复制代码
docker save alpine:3.15 > alpine-3.15.tar

2 上传镜像到需要的节点, (这里直接本机操作,跳过)

复制代码
scp alpine-3.15.tar root@192.168.232.6:~

3 将tar导入到containerd镜像中(注意: 导出导入需要指定镜像平台类型 --platform,不然会出问题。

复制代码
ctr -n k8s.io images import alpine-3.15.tar --platform linux/amd64

4 检查containerd 本地镜像

复制代码
[root@master ~]# crictl images
IMAGE                                                             TAG                 IMAGE ID            SIZE
...
docker.io/library/alpine                                          3.15                c059bfaa849c4       5.87MB
...
相关推荐
Avan_菜菜9 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
程序员老赵10 小时前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua11114 小时前
LM Studio Docker 部署——本地大模型一键启动
docker
Sokach101518 小时前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB1 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao1 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
曲幽2 天前
别再用网页翻译看源码了!你的私人翻译神器LibreTranslate,部署避坑指南来了
python·docker·web·pot·translate·libretranslate·arogstranslate
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220703 天前
如何搭建本地yum源(上)
运维