ajout de scripts d'import/export d'images

master
Votre Nom 2024-12-19 11:26:47 +01:00
parent dcd551e4f2
commit d9d3565519
2 changed files with 23 additions and 0 deletions

17
docker_export_images Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
IFS=$'\n'
for i in $(docker images | grep -ve "^REPOSITORY");do
name=`echo $i | awk '{print $1}'`
tag=`echo $i | awk '{print $2}'`
fname="$name:$tag"
new="$fname"
new=`echo "$new" | sed "s/:/@/g"`
new=`echo "$new" | sed "s/\//_/g"`
new=`echo "$new" | sed "s/:/@/g"`
new="$new.tar"
echo "new: $new"
docker save "$fname" -o "$new"
done

6
docker_import_images Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
IFS=$'\n'
for i in *.tar;do
docker load -i "$i"
done