Docker save/load 与 export/import

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。