Mirror amd64 and arm64 images.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Stanislav Nikitin 2022-06-27 12:53:36 +05:00
parent f88c396ee9
commit beae8447ec
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550

View File

@ -8,12 +8,13 @@ USER=${REGISTRY_USER}
PASSWORD=${REGISTRY_PASSWORD}
function mirror() {
image=$1
local image=$1
local os_and_arch=$2
image_name=$(echo "${image}" | cut -d":" -f 1)
image_version=$(echo "${image}" | cut -d":" -f 2)
echo -n "Mirroring ${image}... "
if ! docker pull "${image}" &> /dev/null; then
if ! docker pull --platform="${os_and_arch}" "${image}" &> /dev/null; then
echo "PULL FAILED"
exit 1
fi
@ -67,5 +68,6 @@ docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
# Mirror images.
for image in "${WHAT_TO_MIRROR[@]}"; do
mirror "${image}"
mirror "${image}" linux/amd64
mirror "${image}" linux/arm64
done