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
...
相关推荐
智能运维指南7 分钟前
代码管理软件如何融入 DevOps 工具链?全链路联通的 5 个关键点
运维·devops·信创适配·嘉为蓝鲸
充电zcx21 分钟前
Linux:4:开发工具详解
linux·运维·服务器
九皇叔叔2 小时前
Kubernetes 核心概念:集群架构、核心组件与资源对象
docker·容器·kubernetes·k8s
rustfs2 小时前
MinIO 国产开源平替正式 GA
分布式·docker·云原生·rust
gongfeng30004 小时前
福州企业级AI自动化获客解决方案品牌梳理与适用场景分析
运维·人工智能·自动化·g-claw ai员工
码农客栈4 小时前
linux 交叉编译tslib
linux
鱼月半5 小时前
两台电脑直连网络不通怎么办?
linux·网络协议
光电笑映6 小时前
网络通信基础:从协议分层到 Socket 编程预备
linux·运维·服务器·网络
酸菜。6 小时前
dw_apb_gpio总结
linux
wunaiqiezixin6 小时前
MIT 6.S081 file system 实验篇(lab9):Large files (moderate)
linux·unix·os·xv6·mit6.s081