風之力

导航

docker导出镜像并压缩

1、使用.tar.gz

导出镜像:

docker save nginx:latest  | gzip > nginx.tar.gz

还原镜像:

gunzip -c nginx.tar.gz | docker load

 

 

2、使用7z

如果没有7z先安装

apt install p7zip-full

备份镜像:docker save nginx:latest  |  7za a -si  nginx.tar.7z

还原镜像:7za x -so nginx.tar.7z | docker load

 

posted on 2021-08-10 16:09  ZY.Zhou  阅读(1723)  评论(0编辑  收藏  举报