From 2df71b654e37d453c5ddcc03fdd22be1cbd6002d Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Sun, 13 May 2018 10:57:07 +0800 Subject: [PATCH] Use gzip to compress system-docker images for dev build --- scripts/tar-images | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/tar-images b/scripts/tar-images index dd98b8c5..6882a171 100755 --- a/scripts/tar-images +++ b/scripts/tar-images @@ -17,6 +17,13 @@ if [ -e ".make-vmware" ]; then IMAGES="$IMAGES rancher/os-openvmtools:${OPEN_VMTOOLS_VERSION}" fi -echo "tar-images: docker save ${IMAGES} > build/images.tar" -docker save ${IMAGES} | xz > build/images.tar +echo "tar-images: docker save ${IMAGES}" +if [ "$COMPRESS" == "" ]; then + docker save ${IMAGES} | gzip > build/images.tar +else + # system-docker can not load images which compressed by xz with a compression level of 9 + # decompression consumes more memory if using level 9 + # the default compression level for xz is 6 + docker save ${IMAGES} | xz -6 -e > build/images.tar +fi echo "tar-images: DONE"