DockerPodman save

DockerPodman save

docker image save

docker save = docker image save

参数只有一个 -o--output ,后接输出文件, 也可以写成 >

, 但> 输出文件只能写在最后 , -o--outpu可以写在前面也可以写在后面

用途: 将Image镜像保存为tar文件

为标准输出流生成一个 tared 存储库。 包含所有父图层,以及所有标签 + 版本,或指定 的 提供的每个参数。

用法1 : sudo docker save REPOSITORY:TAG --output xxx.tar

用法2 : sudo docker save --output xxx.tar REPOSITORY:TAG

用法3 : sudo docker save REPOSITORY:TAG -o xxx.tar

用法4 : sudo docker save REPOSITORY:TAG > xxx.tar

也可将 REPOSITORY:TAG 换成 ImageId , 但保存的文件不完全一样, load时也没有 REPOSITORY 和 TAG

实例

sh 复制代码
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
centos       7         eeb6ee3f44bd   2 years ago    204MB
root@ud2243-esxi-6412:~/docker# sudo docker save centos:7 --output DockerSave_centos-7_eeb6ee3f44bd.tar
sh 复制代码
sudo docker save centos:7 --output DockerSave_centos-7_eeb6ee3f44bd.tar

将Image镜像保存为tar文件,并继续转为gzip的例子

sh 复制代码
docker save myimage:latest | gzip > myimage_latest.tar.gz
可以将多个image保存save为一个image

可以将多个image保存save为一个image, load时,多个image都恢复了

sh 复制代码
docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy

实测

sh 复制代码
sudo docker save -o test.tar mysql:8.0.36 mysql:8.3.0
sh 复制代码
sudo docker save mysql:8.0.36 mysql:8.3.0 mysql:8.0.33 > 'mysql_830,8033,8036image.tar'
相关推荐
独隅8 小时前
PyTorch 模型部署的 Docker 配置与性能调优深入指南
人工智能·pytorch·docker
yuzhuanhei11 小时前
docker常用命令
运维·docker·容器
我叫张小白。11 小时前
Dify系列(一):平台安装部署+界面操作
docker·ai·语言模型·大模型·dify·智能体
anarckk11 小时前
docker volume 导入导出命令
运维·docker·容器
Brandon汐11 小时前
从0开始搭建一主两节点k8s集群对接Ceph集群
ceph·容器·kubernetes
杨浦老苏12 小时前
音乐和有声读物播放器AudioDock
docker·群晖·多媒体·音乐·有声读物
gordon~913 小时前
Windows 11 wsl 中安装的Ubuntu-24.04 中装docker
windows·ubuntu·docker
F1FJJ13 小时前
Shield CLI 命令全解析:15 个命令覆盖所有远程访问场景
网络·数据库·网络协议·容器·开源软件