Created
October 7, 2020 18:35
-
-
Save Oats87/4654f3d24ac589dbcf628cfe415b2ea8 to your computer and use it in GitHub Desktop.
Requires skopeo and lots of disk space
This file contains hidden or 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 | |
REPO=${REPO:-rancher} | |
IMAGE=${IMAGE:-rancher-agent} | |
TAG=${TAG:-v2.5.1-rc1} | |
DESTREPO=${DESTREPO:-oats87} | |
DESTIMAGE=${DESTIMAGE:-$IMAGE} | |
DESTTAG=${DESTTAG:-$TAG} | |
ARCHES=${ARCHES:-linux-amd64,linux-arm64,windows-1809,windows-1903,windows-1909} | |
TOGETHER=${REPO}-${IMAGE}-${TAG} | |
mkdir -p ${TOGETHER} | |
if [ ${DESTTAG} = latest ]; then | |
echo Not pushing individual arches for corresponding tag because we are pushing latest | |
else | |
IFS=, | |
for arch in ${ARCHES}; do | |
skopeo copy dir:./${TOGETHER}/${arch} docker://docker.io/${DESTREPO}/${DESTIMAGE}:${TAG}-${arch} | |
done | |
unset IFS | |
fi | |
skopeo copy --all dir:./${TOGETHER}/all docker://docker.io/${DESTREPO}/${DESTIMAGE}:${DESTTAG} |
This file contains hidden or 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 | |
REPO=${REPO:-rancher} | |
IMAGE=${IMAGE:-rancher-agent} | |
TAG=${TAG:-v2.5.1-rc1} | |
ARCHES=${ARCHES:-linux-amd64,linux-arm64,windows-1809,windows-1903,windows-1909} | |
TOGETHER=${REPO}-${IMAGE}-${TAG} | |
mkdir -p ${TOGETHER} | |
IFS=, | |
for arch in ${ARCHES}; do | |
skopeo copy docker://docker.io/${REPO}/${IMAGE}:${TAG}-${arch} dir:./${TOGETHER}/${arch} | |
done | |
unset IFS | |
skopeo copy --all docker://docker.io/${REPO}/${IMAGE}:${TAG} dir:./${TOGETHER}/all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment