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 ...
随机推荐
- pyspider 示例二 升级完整版绕过懒加载,直接读取图片
pyspider 示例二 升级完整版绕过懒加载,直接读取图片,见[升级写法处] #!/usr/bin/env python # -*- encoding: utf-8 -*- # Created on ...
- memcache、redis、mongoDB 如何选择?
不同的 Nosql,其实应用的场景各有不同,所以我们应该先了解不同Nosql 之间的差别,然后分析什么才是最适合我使用的 Nosql. Nosql 介绍 Nosql 的全称是 Not Only Sql ...
- Go语言专题
基础语法 Go语言配置开发环境 Go语言语法基础 Go语言面向对象 Go语言并发编程 Go语言搭建开发环境 语言库 Go语言fmt包 Go语言字节处理 Go语言字符串处理 Go语言JSON处理 Go语 ...
- springboot用@Autowired和@PostConstruct注解把config配置读取到bean变成静态方法
springboot用@Autowired和@PostConstruct注解把config配置读取到bean变成静态方法 @SpringBootApplication public class Sen ...
- 两眼论&矩阵变现理论结合打造赚钱大模式
两眼论&矩阵变现理论结合打造赚钱大模式 围棋有一个基本规则,就是一块棋有两只真眼,就是活棋. 围棋没有复杂的规则,它最有趣的地方是没有太多的规则和限制,由此演变出了大千世界,所以古人云“棋如人 ...
- 前端框架VUE----学习vue前的准备工作
起步 1.扎实的HTML/CSS/Javascript基本功,这是前置条件. 2.不要用任何的构建项目工具,只用最简单的<script>,把教程里的例子模仿一遍,理解用法.不推荐上来就直接 ...
- 常用的node.js模块
一.url模块1.url.parse:将一个url转换成一个对象 1)参数1:url 2)参数2:布尔值 3)如果参数2是一个true的情况下会将query解析成一个对象2.url.format:将一 ...
- mysql01
CREATE TABLE `student`( `studentNo` INT (4) NOT NULL PRIMARY KEY COMMENT '学号', `loginPwd` VARCHAR(20 ...
- 通过经纬度获取所属城市信息-php
测试经纬度信息,37.863036,113.598909.通过地图查询,所在城市为:阳泉. <?php class test{ public static $test_key = 'dfgfdg ...
- R语言开发环境搭建
R语言开发环境搭建 一.环境 Win7 64bit系统 二.R软件下载 R 3.5.2 for Windows,官网:https://www.r-project.org/ RStudio 1.1.46 ...