Docker image import load, export save and rename

Docker import and export operations


save Save (export) the image

# 把镜像打包成 .tar
# -o 要保存路径.tar
# >  要保存路径.tar
# docker save 镜像id > /存储路径/xxx.tar
docker save fce91102e17d>/root/tomcat.tar

# docker save 镜像id -o 存储路径
docker save fce91102e17d -o /root/tomcat.tar

export export container

# docker export 容器id > /保存路径/xxx.tar
docker export dbee90b04efd > /home/nginxApps.tar

load import image

# 加载镜像
# -i .tar包路径
# <  .tar包路径
# docker load</镜像路径/xxx.tar
docker load</root/tomcat.tar

# docker load -i /路径/xxx.tar
docker load -i /root/tomcat.tar

import import mirror

# docker import /镜像路径/xx.tar 新镜像名
docker import /root/tomcat.tar tomcat01

Load cannot be named when importing, import can name the mirror


Official document: https://docs.docker.com/engine/reference/commandline/save/

Guess you like

Origin blog.csdn.net/weixin_44953227/article/details/108755743