Docker save & load
docker save
Estimated reading time: 1 minute
Description
Save one or more images to a tar archive (streamed to STDOUT by default)
Usage
docker save [OPTIONS] IMAGE [IMAGE...]
Options
| Name, shorthand | Default | Description |
--output , -o |
Write to a file, instead of STDOUT |
Parent command
| Command | Description |
|---|---|
| docker | The base command for the Docker CLI. |
Extended description
Produces a tarred repository to the standard output stream. Contains all parent layers, and all tags + versions, or specified repo:tag, for each argument provided.
Examples
Create a backup that can then be used with docker load.
$ docker save busybox > busybox.tar $ ls -sh busybox.tar 2.7M busybox.tar $ docker save --output busybox.tar busybox $ ls -sh busybox.tar 2.7M busybox.tar $ docker save -o fedora-all.tar fedora $ docker save -o fedora-latest.tar fedora:latest
Cherry-pick particular tags
You can even cherry-pick particular tags of an image repository.
$ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
docker load
Estimated reading time: 1 minute
Description
Load an image from a tar archive or STDIN
Usage
docker load [OPTIONS]
Options
| Name, shorthand | Default | Description |
--input , -i |
Read from tar archive file, instead of STDIN | |
--quiet , -q |
Suppress the load output |
Parent command
| Command | Description |
|---|---|
| docker | The base command for the Docker CLI. |
Extended description
Load an image or repository from a tar archive (even if compressed with gzip, bzip2, or xz) from a file or STDIN. It restores both images and tags.
Examples
$ docker docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE $ docker load < busybox.tar.gz Loaded image: busybox:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 769b9341d937 7 weeks ago 2.489 MB $ docker load --input fedora.tar Loaded image: fedora:rawhide Loaded image: fedora:20 $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 769b9341d937 7 weeks ago 2.489 MB
fedora rawhide 0d20aec6529d 7 weeks ago 387 MB
fedora 20 58394af37342 7 weeks ago 385.5 MB
fedora heisenbug 58394af37342 7 weeks ago 385.5 MB
fedora latest 58394af37342 7 weeks ago 385.5 MB
You will need to save the docker image as a tar file:
docker save -o <save image to path> <image name>
Then copy your image to a new system with regular file transfer tools such as cp or scp. After that you will have to load the image into docker:
docker load -i <path to image tar file>
PS: You may need to sudo all commands.
docker save -o testxp.tar 347084c24033 #save imge:347084c24033 to file: testxp.tar docker load -i testxp.tar #load file:testxp.tar to get image docker run 347084c24033 #run image to get container docker rm -f b8b3e1503e6f #remove container:b8b3e1503e6f docker rmi 347084c24033 #remove image:347084c24033
docker run -d -e NLOGDIR=/var/log/ -e WWNamespace=dev -e ZKServerAddress=********* -p 5005:80 98006abba2695082cb9aa325ff2858285d8b6df09af517028405aed88c5410ff69d6f3e984fc
Docker save & load的更多相关文章
- 使用docker save load 的时候的一个小问题
当你使用docker save image_id > aa.tar ; 然后再使用 docker load < aa.tar 时, 你会发现此时导入的镜像的repository和 tag ...
- docker save load export import的区别
export export命令用于持久化容器(不是镜像).所以,我们就需要通过以下方法得到容器ID: sudo docker ps -a 接着执行导出: sudo docker export < ...
- docker save/load以及export/import使用测试
对于有些环境需要离线安装的情况,docker以及docker容器都需要能够支持离线安装,对于docker离线安装,比较简单,按照https://www.cnblogs.com/qq931399960/ ...
- docker save/load、export/import 区别
区别: save的对象是image,产生的文件需要用load来生成image: export的对象是container,产生的文件需要用import来生成image. save Save one or ...
- docker~save与load的使用
回到目录 对于没有私有仓库来说,将本地镜像放到其它服务器上执行时,我们可以使用save和load方法,前者用来把镜像保存一个tar文件,后台从一个tar文件恢复成一个镜像,这个功能对于我们开发者来说还 ...
- [转帖]Docker save and load镜像保存
Docker save and load镜像保存 https://www.cnblogs.com/zhuochong/p/10064350.html docker save 和 load 以及 imp ...
- Docker(十三)-Docker save and load镜像保存
持久化docker的镜像或容器的方法 Docker的镜像和容器可以有两种方式来导出 docker save #ID or #Name docker export #ID or #Name docker ...
- docker save docker load
docker save && docker load docker save 镜像1 镜像2 | gzip > images.tar.gz 打包镜像为压缩文件 docker sa ...
- Docker save and load,镜像保存
一.起因 docker pull 时发生错误 error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/r ...
随机推荐
- SLAM学习笔记 - 视觉SLAM方法资源汇总
工具类: ros框架 linux系列教程 vim Eigen Eigen快速入门 Pangolin Pangolin安装与使用 数据集: TUM 数据格式 提供pyt ...
- 使用QFileDiaglog实战designer快速开发
今天遇到一个大坑很久才解决 使用designer开发出图形界面转换为py文件后,使用QFileDialog对话框第一个参数一定要是当前窗口组件,否则程序直接奔溃(坑:能运行不报错但奔溃) def ge ...
- flask 处理表单数据
处理表单数据 表单数据的处理涉及很多内容,从获取数据到保存数据大致有以下步骤: 1. 解析请求,获取表单数据 2. 对数据进行必要的转换,比如讲勾选框的值转换成python的布尔值 3. 验证数 ...
- Linux服务器---邮件服务spam
安装spam spam(SpamAssassin)利用perl来进行文字分析,他会检测邮件的标题.内容.送信人,这样就可以过滤出垃圾邮件 1.安装spam.由于spam的依赖太多,用户一定要使用yum ...
- AEC、AGC、ANS在视音频会议中的作用?
AGC是自动增益补偿功能(Automatic Gain Control),AGC可以自动调麦克风的收音量,使与会者收到一定的音量水平,不会因发言者与麦克风的距离改变时,声音有忽大忽小声的缺点.ANS是 ...
- Linux文件管理和编辑常用命令
Linux文件管理和编辑常用命令 mkdir 命令 功能说明 mkdir 命令用于创建一个目录,mkdir是make directory的缩写 格式: mkdir [选项] 目录名 mkdir 命令的 ...
- 3、CentOS 6.5系统安装配置Tomcat 8详细过程
安装环境:CentOS-6.5 安装方式:源码安装 软件:apache-tomcat-8.0.0.RC3.tar.gz 安装前提 安装tomcat 将apache-tomcat-8.0.0.RC3.t ...
- java中避免乱码
response.setContentType("text/html;charset=UTF-8"); 这个是在action中的 这个是在json中设置乱码的 contentTyp ...
- P1601 A+B Problem(高精加法)
[高精度就是一个固定的格式吧] #include<iostream>#include<cstdio>#include<cmath>#include<algor ...
- hiho一下 第144周
题目1 : 机会渺茫 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi最近在追求一名学数学的女生小Z.小Z其实是想拒绝他的,但是找不到好的说辞,于是提出了这样的要求: ...