美文网首页
Docker save/load 与 export/import

Docker save/load 与 export/import

作者: 心水Diana | 来源:发表于2019-03-05 15:15 被阅读0次

export/import

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

命令

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

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
  • save

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
  • load

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

docker load < alpine.tar.gz

image.png
  • commit

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,操作步骤明确可查。

相关文章

网友评论

      本文标题:Docker save/load 与 export/import

      本文链接:https://www.haomeiwen.com/subject/zqxnuqtx.html