1. 程式人生 > >Docker image批量save和load

Docker image批量save和load

save

docker images > /root/kolla/images.txt
awk '{print $1}' /root/kolla/images.txt > /root/kolla/images_cut.txt
while read LINE
do
#echo $LINE
docker save $LINE > /home/$LINE.tar
echo ok
done < /root/kolla/images_cut.txt
echo finish

load

#!/bin/sh
#============ get the file name ===========
Folder_A="/home/lokolla"
for file_a in ${Folder_A}/*; do temp_file=`basename $file_a` # echo $temp_file docker load < /home/lokolla/$temp_file echo ok done echo finish