Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support zstd as archive format #469

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/0_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/3_load_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down