Removed doonation link and removed arm64 mirroring as gitea unable to handle it properly.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Stanislav Nikitin 2022-06-27 13:07:04 +05:00
parent beae8447ec
commit 68137b31c1
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550
2 changed files with 11 additions and 6 deletions

View File

@ -7,8 +7,6 @@ Docker Hub ratelimiting shit.
Feel free to use and re-use these images and this mirrorer.
If it helps you much - please, [donate](https://paypal.me/pztrn)
## How to use
This script assumes that you are already logged in into Gitlab Registry.

View File

@ -13,15 +13,22 @@ function mirror() {
image_name=$(echo "${image}" | cut -d":" -f 1)
image_version=$(echo "${image}" | cut -d":" -f 2)
echo -n "Mirroring ${image}... "
echo -n "Mirroring ${image} for '${os_and_arch}'... "
if ! docker pull --platform="${os_and_arch}" "${image}" &> /dev/null; then
echo "PULL FAILED"
if [ "${os_and_arch/linux\/amd64//}" != "${os_and_arch}" ] ; then
exit 1
fi
return
fi
# shellcheck disable=SC1083
image_hash=$(docker images -a | grep "^${image_name}" | grep "${image_version}" | awk {' print $3 '})
echo -n "${image_hash} received, retag as '${DESTINATION_PROJECT}/${image}'... "
echo -n "${image_hash} for '${os_and_arch}' received, retag as '${DESTINATION_PROJECT}/${image}'... "
if ! docker tag "${image_hash}" "${DESTINATION_PROJECT}/${image}" &> /dev/null; then
echo "TAGGING FAILED"
@ -69,5 +76,5 @@ docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
# Mirror images.
for image in "${WHAT_TO_MIRROR[@]}"; do
mirror "${image}" linux/amd64
mirror "${image}" linux/arm64
#mirror "${image}" linux/arm64
done