-
docker 镜像与容器
相关的命令有对应的两对,分别针对镜像和容器操作:
-
docker save : Save one or more images to a tar archive(streamed to STDOUT by default)
docker save [OPTIONS] IMAGE [IMAGE...]
docker save busybox > busybox.tar
-
docker load : load an image from a tar archive or STDIN
docker load [OPTIONS]
docker load < busybox.tar.gz
-
docker export : export a container’s filesystem as a tar archive
docker export [OPTIONS] CONTAINER
docker export red_panda > latest.tar
-
docker import : import the contents from a tarball to create a filesystem image
docker import [OPTIONS] file | URL | -[REPOSITORY[:TAG]]
docker import /path/to/exampleimage.tgz
区别在于:
- docker save保存的是images,docker export 保存的是container;
- docker load载入images包,docker import载入container包,两者都会恢复为镜像;
- docker load不能对载入的镜像重命名,docker import可以为镜像指定新名字;
-
docker镜像容器的保存与导入
最新推荐文章于 2024-04-22 10:01:32 发布