tar-images 894 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -ex
  3. cd $(dirname $0)/..
  4. IMAGES=$(bin/host_ros c images -i build/initrd/usr/share/ros/os-config.yml)
  5. echo "tar-image: IMAGES=$IMAGES"
  6. for i in $IMAGES; do
  7. echo "tar-image: pull($i)"
  8. if [ "${FORCE_PULL}" = "1" ] || ! docker inspect $i >/dev/null 2>&1; then
  9. docker pull $i
  10. fi
  11. done
  12. if [ -e ".make-vmware" ]; then
  13. docker pull rancher/os-openvmtools:${OPEN_VMTOOLS_VERSION}
  14. IMAGES="$IMAGES rancher/os-openvmtools:${OPEN_VMTOOLS_VERSION}"
  15. fi
  16. echo "tar-images: docker save ${IMAGES}"
  17. if [ "$COMPRESS" == "" ]; then
  18. docker save ${IMAGES} | gzip > build/images.tar
  19. else
  20. # system-docker can not load images which compressed by xz with a compression level of 9
  21. # decompression consumes more memory if using level 9
  22. # the default compression level for xz is 6
  23. docker save ${IMAGES} | xz -6 -e > build/images.tar
  24. fi
  25. echo "tar-images: DONE"