Skip to content

Instantly share code, notes, and snippets.

@if6was9
Created March 4, 2021 16:38
Show Gist options
  • Save if6was9/6c956fd7101df1d2e77aca5fffe02939 to your computer and use it in GitHub Desktop.
Save if6was9/6c956fd7101df1d2e77aca5fffe02939 to your computer and use it in GitHub Desktop.
mirror-soluble-repos.sh
#!/bin/bash
set -e
mirror_soluble_image() {
IMAGE=$1
TAG=$1
SOURCE_IMAGE=gcr.io/soluble-repo/$1:$2
TARGET_IMAGE=${MIRROR_REPO}/$1:$2
echo
echo "mirroring ${SOURCE_IMAGE} ==> ${TARGET_IMAGE}"
docker pull ${SOURCE_IMAGE}
docker tag ${SOURCE_IMAGE} ${TARGET_IMAGE}
docker push ${TARGET_IMAGE}
}
MIRROR_REPO=$1
if [ "${MIRROR_REPO}" = "" ]; then
echo "usage: $0 <repo>"
echo
echo "example: $0 gcr.io/example"
echo
exit 1
fi
mirror_soluble_image soluble-tools stable
mirror_soluble_image zodiac stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment