Docker save/load 与 export/import

2019-03-05  本文已影响0人  心水Diana

export/import

Description
Export a container’s filesystem as a tar archive
将容器导出为tar文件.

命令

docker export <container id/name>  > latest.tar
docker export --output=" latest.tar"  <container id/name>
image.png

Description
Import the contents from a tarball to create a filesystem image
将export导出tar包导入

# 从文件 URL 中导入
docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]] 
cat exampleimage.tgz | docker import  -  exampleimagelocal:new
image.png

Description
Save one or more images to a tar archive (streamed to STDOUT by default)
将镜像保存至tar文件中

 docker save busybox > busybox.tar
 docker save -o fedora-all.tar fedora
image.png

Description
Load an image from a tar archive or STDIN
从文件或者标准输入 载入 镜像

docker load < alpine.tar.gz

image.png

Description
Create a new image from a container’s changes

容器最上层为R/W 保存修改后容器

docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
docker commit  alpine apline:v1

commit 提交容器为黑箱操作。建议使用Dockerfile,操作步骤明确可查。

上一篇 下一篇

猜你喜欢

热点阅读