Docker部署归档
Docker image save&load
save命令介绍
[root@galaxy-node-master ~]# docker image save --help
Usage: docker image save [OPTIONS] IMAGE [IMAGE...]
Save one or more images to a tar archive (streamed to STDOUT by default)
Options:
-o, --output string Write to a file, instead of STDOUT
将镜像导出到本地文件
$ docker image save -o kkb-nginx.tar kkb/nginx
# 将kkb/nginx打包为本地文件 kkb-nginx.tar
或者
$ docker image save kkb/nginx > kkb-nginx.tar
Load命令介绍
[root@galaxy-node-master ~]# docker image load --help
Usage: docker image load [OPTIONS]
Load an image from a tar archive or STDIN
Options:
-i, --input string Read from tar archive file, instead of STDIN
-q, --quiet Suppress the load output
将镜像导出到本地文件
$ docker image load --input kkb-nginx.tar
# 将kkb-nginx.tar解压,解压出kkb/nginx
或者
$ docker image load < kkb-nginx.tar