-
-
Save bdimcheff/3974944d40c5ee94fec2d7232b877211 to your computer and use it in GitHub Desktop.
mirror go 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
#!/bin/bash | |
FLAGS="" | |
SOURCE="docker.io/library" | |
DEST="docker.io/bdimcheff" | |
IMAGE="golang" | |
TAG="1.16.4-alpine" | |
docker buildx imagetools inspect ${SOURCE}/${IMAGE}:${TAG} --raw | \ | |
jq -r '.manifests[] | (.digest + " " + .platform.architecture + .platform.variant)' | \ | |
while read DIGEST ARCH; do | |
docker pull ${SOURCE}/${IMAGE}:${TAG}@${DIGEST} | |
docker tag ${SOURCE}/${IMAGE}:${TAG}@${DIGEST} ${DEST}/${IMAGE}:${TAG}-${ARCH} | |
docker push ${DEST}/${IMAGE}:${TAG}-${ARCH} | |
docker buildx imagetools create ${FLAGS} --tag ${DEST}/${IMAGE}:${TAG} ${DEST}/${IMAGE}:${TAG}-${ARCH}; | |
docker buildx imagetools create ${FLAGS} --tag ${DEST}/${IMAGE}:latest ${DEST}/${IMAGE}:${TAG}-${ARCH}; | |
FLAGS="--append" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment