2016-05-06 17:12:09 +00:00
|
|
|
#!/bin/bash
|
2017-07-12 04:18:02 +00:00
|
|
|
set -ex
|
2016-05-06 17:12:09 +00:00
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2017-03-13 05:57:57 +00:00
|
|
|
IMAGES=$(bin/host_ros c images -i build/initrd/usr/share/ros/os-config.yml)
|
2017-03-14 02:05:07 +00:00
|
|
|
echo "tar-image: IMAGES=$IMAGES"
|
2016-05-06 17:12:09 +00:00
|
|
|
for i in $IMAGES; do
|
2017-03-14 02:05:07 +00:00
|
|
|
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
|
|
|
|
|
2018-05-13 02:57:07 +00:00
|
|
|
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
|
2017-03-14 02:05:07 +00:00
|
|
|
echo "tar-images: DONE"
|