This help to remove the extra dependency on different container image registry. Docker Hub now holds all Longhorn components' images. Also, users can easily pull all the necessary images to their air-gap environment Longhorn #1419 Signed-off-by: Phan Le <phan.le@rancher.com>
45 lines
789 B
Bash
Executable File
45 lines
789 B
Bash
Executable File
#!/bin/bash
|
|
list="longhorn-images.txt"
|
|
images="longhorn-images.tar.gz"
|
|
|
|
POSITIONAL=()
|
|
while [[ $# -gt 0 ]]; do
|
|
key="$1"
|
|
case $key in
|
|
-i|--images)
|
|
images="$2"
|
|
shift # past argument
|
|
shift # past value
|
|
;;
|
|
-l|--image-list)
|
|
list="$2"
|
|
shift # past argument
|
|
shift # past value
|
|
;;
|
|
-h|--help)
|
|
help="true"
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
usage () {
|
|
echo "USAGE: $0 [--image-list longhorn-images.txt] [--images longhorn-images.tar.gz]"
|
|
echo " [-l|--images-list path] text file with list of images. 1 per line."
|
|
echo " [-l|--images path] tar.gz generated by docker save."
|
|
echo " [-h|--help] Usage message"
|
|
}
|
|
|
|
if [[ $help ]]; then
|
|
usage
|
|
exit 0
|
|
fi
|
|
|
|
set -e -x
|
|
|
|
for i in $(cat ${list}); do
|
|
docker pull ${i}
|
|
done
|
|
|
|
docker save $(cat ${list} | tr '\n' ' ') | gzip -c > ${images}
|