list:

#备份镜像列表
docker images|awk 'NR>1{print $1":"$2}'|sort > images.list 

save:

#导出所有镜像为当前目录下文件:
while read img; do
    echo $img
    file="${img/\//-}"
    sudo docker save --output $file.tar $img
done < images.list

load:

#将本地镜像文件导入为Docker镜像:
while read img; do
    echo $img
    file="${img/\//-}"
    docker load < $file.tar
done < images.list

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code