1
0
mirror of https://github.com/rancher/os.git synced 2025-06-23 13:37:03 +00:00
os/scripts/tar-images
niusmallnan 8cda43a68a
Reduce the memory consumption at startup (#2247)
Offline image is automatically loaded when the system boots.
When the system memory is not large enough (such as 1G), will lead to
kernel panic.
2018-02-05 17:43:39 +08:00

18 lines
447 B
Bash
Executable File

#!/bin/bash
set -ex
cd $(dirname $0)/..
IMAGES=$(bin/host_ros c images -i build/initrd/usr/share/ros/os-config.yml)
echo "tar-image: IMAGES=$IMAGES"
for i in $IMAGES; do
echo "tar-image: pull($i)"
if [ "${FORCE_PULL}" = "1" ] || ! docker inspect $i >/dev/null 2>&1; then
docker pull $i
fi
done
echo "tar-images: docker save ${IMAGES} > build/images.tar"
docker save ${IMAGES} | xz > build/images.tar
echo "tar-images: DONE"