diff --git a/scripts/0_prepare.sh b/scripts/0_prepare.sh index 52cc6e55..7fc397b1 100644 --- a/scripts/0_prepare.sh +++ b/scripts/0_prepare.sh @@ -59,7 +59,7 @@ function prepare_image_files() { images=$(get_images) for image in ${images}; do - filename=$(basename "${image}").tar + filename=$(basename "${image}").zst image_path="${IMAGE_DIR}/${filename}" md5_filename=$(basename "${image}").md5 md5_path="${IMAGE_DIR}/${md5_filename}" @@ -83,7 +83,8 @@ function prepare_image_files() { fi fi echo "$(gettext 'Save image') ${image} -> ${image_path}" - docker save -o "${image_path}" "${image}" & + # docker save -o "${image_path}" "${image}" & + docker save "${image}" | zstd -f -q -o "${image_path}" & echo "${image_id}" >"${md5_path}" & done wait diff --git a/scripts/3_load_images.sh b/scripts/3_load_images.sh index dde6f0a4..ae8bf7c5 100755 --- a/scripts/3_load_images.sh +++ b/scripts/3_load_images.sh @@ -10,7 +10,7 @@ IMAGE_DIR="images" function load_image_files() { images=$(get_images) for image in ${images}; do - filename=$(basename "${image}").tar + filename=$(basename "${image}").zst filename_windows=${filename/:/_} if [[ -f ${IMAGE_DIR}/${filename_windows} ]]; then filename=${filename_windows} @@ -39,7 +39,7 @@ function load_image_files() { } function main() { - if [[ -d "${IMAGE_DIR}" && $(find "${IMAGE_DIR}" -type f -name "*.tar" -print -quit 2>/dev/null) ]]; then + if [[ -d "${IMAGE_DIR}" && $(find "${IMAGE_DIR}" -type f -name "*.zst" -print -quit 2>/dev/null) ]]; then load_image_files else pull_images