1
0
mirror of https://github.com/rancher/os.git synced 2025-06-19 03:31:55 +00:00
os/scripts/tar-images

30 lines
894 B
Plaintext
Raw Normal View History

2016-05-06 17:12:09 +00:00
#!/bin/bash
set -ex
2016-05-06 17:12:09 +00:00
cd $(dirname $0)/..
IMAGES=$(bin/host_ros c images -i build/initrd/usr/share/ros/os-config.yml)
echo "tar-image: IMAGES=$IMAGES"
2016-05-06 17:12:09 +00:00
for i in $IMAGES; do
echo "tar-image: pull($i)"
2016-05-06 17:12:09 +00:00
if [ "${FORCE_PULL}" = "1" ] || ! docker inspect $i >/dev/null 2>&1; then
docker pull $i
fi
done
2018-05-10 04:33:16 +00:00
if [ -e ".make-vmware" ]; then
2018-05-12 09:18:30 +00:00
docker pull rancher/os-openvmtools:${OPEN_VMTOOLS_VERSION}
IMAGES="$IMAGES rancher/os-openvmtools:${OPEN_VMTOOLS_VERSION}"
2018-05-10 04:33:16 +00:00
fi
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"