-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from FabianKramm/dev
connect flags & docs update
- Loading branch information
Showing
31 changed files
with
940 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
list="vcluster-images.txt" | ||
images="vcluster-images.tar.gz" | ||
|
||
usage () { | ||
echo "USAGE: $0 [--image-list vcluster-images.txt] [--images vcluster-images.tar.gz]" | ||
echo " [-l|--image-list path] text file with list of images; one image per line." | ||
echo " [-i|--images path] tar.gz generated by docker save." | ||
echo " [-h|--help] Usage message" | ||
} | ||
|
||
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 | ||
;; | ||
*) | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [[ $help ]]; then | ||
usage | ||
exit 0 | ||
fi | ||
|
||
pulled="" | ||
while IFS= read -r i; do | ||
[ -z "${i}" ] && continue | ||
if docker pull "${i}" > /dev/null 2>&1; then | ||
echo "Image pull success: ${i}" | ||
pulled="${pulled} ${i}" | ||
else | ||
if docker inspect "${i}" > /dev/null 2>&1; then | ||
pulled="${pulled} ${i}" | ||
else | ||
echo "Image pull failed: ${i}" | ||
fi | ||
fi | ||
done < "${list}" | ||
|
||
echo "Creating ${images} with $(echo ${pulled} | wc -w | tr -d '[:space:]') images" | ||
docker save $(echo ${pulled}) | gzip --stdout > ${images} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
images="vcluster-images.tar.gz" | ||
list="vcluster-images.txt" | ||
usage () { | ||
echo "USAGE: $0 [--images vcluster-images.tar.gz] --registry my.registry.com:5000" | ||
echo " [-l|--image-list path] text file with list of images; one image per line." | ||
echo " [-i|--images path] tar.gz generated by docker save." | ||
echo " [-r|--registry registry:port] target private registry:port." | ||
echo " [-h|--help] Usage message" | ||
} | ||
|
||
push_manifest () { | ||
export DOCKER_CLI_EXPERIMENTAL=enabled | ||
manifest_list=() | ||
for i in "${arch_list[@]}" | ||
do | ||
manifest_list+=("$1-${i}") | ||
done | ||
|
||
echo "Preparing manifest $1, list[${arch_list[@]}]" | ||
docker manifest create "$1" "${manifest_list[@]}" --amend | ||
docker manifest push "$1" --purge | ||
} | ||
|
||
while [[ $# -gt 0 ]]; do | ||
key="$1" | ||
case $key in | ||
-r|--registry) | ||
reg="$2" | ||
shift # past argument | ||
shift # past value | ||
;; | ||
-l|--image-list) | ||
list="$2" | ||
shift # past argument | ||
shift # past value | ||
;; | ||
-i|--images) | ||
images="$2" | ||
shift # past argument | ||
shift # past value | ||
;; | ||
-h|--help) | ||
help="true" | ||
shift | ||
;; | ||
*) | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
if [[ -z $reg ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
if [[ $help ]]; then | ||
usage | ||
exit 0 | ||
fi | ||
|
||
docker load --input ${images} | ||
|
||
linux_images=() | ||
while IFS= read -r i; do | ||
[ -z "${i}" ] && continue | ||
linux_images+=("${i}"); | ||
done < "${list}" | ||
|
||
arch_list+=("linux-amd64") | ||
for i in "${linux_images[@]}"; do | ||
[ -z "${i}" ] && continue | ||
case $i in | ||
*/*) | ||
image_name="${reg}/${i}" | ||
;; | ||
*) | ||
image_name="${reg}/loftsh/${i}" | ||
;; | ||
esac | ||
|
||
docker tag "${i}" "${image_name}" | ||
docker push "${image_name}" | ||
done |
Oops, something went wrong.