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'
相关推荐
冯浩(grow up)4 小时前
macOS可视化桌面配置docker加速器
macos·docker·容器
Micheal_Dad4 小时前
在macOS的docker中如何安装及运行ROS2
macos·docker
桥边驿语人6 小时前
使用Docker Desktop进行本地打包和推送
运维·docker·容器·本地打包
sondx8 小时前
mac安装浏览器闪退处理
运维·docker·容器
郭涤生9 小时前
第二章:Docker及Kubernetes基础 重难点详解_《再也不踩坑的kubernetes实战指南》
笔记·docker·容器·kubernetes
知其_所以然9 小时前
docker安装软件汇总(持续更新)
运维·docker·容器
limnade10 小时前
将已有 SVN 服务打包成 Docker 镜像的详细步骤
linux·运维·docker
ALe要立志成为web糕手11 小时前
docker使用
docker·容器·eureka
chengpei14711 小时前
docker配置远程连接,dockerfile-maven-plugin插件打包到远程
spring boot·docker·maven
GreenMountainEcho12 小时前
Kubernetes 入门篇之网络插件 calico 部署与安装
网络·容器·kubernetes