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'
相关推荐
人生百态,人生如梦38 分钟前
Ubuntu在低版本下使用ccswitch+claudecode(CCSwitch+Docker+Claude)连调教程
linux·ubuntu·docker·claudecode·ccswitch
程序员老赵43 分钟前
Docker 部署 OpenViking:轻松搭建 AI Agent 上下文数据库平台
docker·开源·agent
吴声子夜歌2 小时前
Docker入门与实战——高级镜像构建
docker
小匠石钧知2 小时前
07_在k8s集群中安装ingress-nginx
nginx·容器·kubernetes·ingress
坐看风云变幻2 小时前
Betaflight 开发环境搭建保姆级教程(Ubuntu / Windows+WSL / Docker 三方案 + 官方网址大全)
windows·ubuntu·docker·无人机·飞控·betaflight
零基础1232 小时前
Docker 部署实战:从入门到精通
docker·容器
Lvan的前端笔记3 小时前
docker:基于docker的前端部署方案
前端·docker·状态模式
承渊政道3 小时前
自建服务越来越多怎么管理?Docker部署Flare,搭一个自己的数字入口
运维·docker·容器·内网穿透·cpolar·nas·flare
龙腾-虎跃4 小时前
Docker 一键启动服务合集:Redis、MySQL、Kafka、MinIO、Prometheus 等(网盘转存防失效)
redis·mysql·docker·kafka·prometheus·小龙虾·miniio
芷栀夏4 小时前
极空间部署Photopea:Docker运行、网页修图与多设备使用
运维·docker·容器