diff options
author | 2024-07-27 12:27:58 +0300 | |
---|---|---|
committer | 2024-09-08 15:46:12 -0700 | |
commit | 99dafa4279156d3064da280c6d3b2f95a788d74d (patch) | |
tree | fde1eee43baa924532df58992f9512e7834fb768 /deploy.sh | |
parent | Fix the example build command (diff) | |
download | docker-images-99dafa4279156d3064da280c6d3b2f95a788d74d.tar.gz docker-images-99dafa4279156d3064da280c6d3b2f95a788d74d.tar.bz2 docker-images-99dafa4279156d3064da280c6d3b2f95a788d74d.zip |
fix: reduce Docker registry pull requests
Circumvent the Docker Hub rate limit triggered by pushing the multiarch
manifests after *every* image is built and pushed. Instead, deploy the
manifests only after *all* images have been built and pushed.
Signed-off-by: Konstantinos Smanis <konstantinos.smanis@gmail.com>
Signed-off-by: John Helmert III <ajak@gentoo.org>
Diffstat (limited to 'deploy.sh')
-rwxr-xr-x | deploy.sh | 54 |
1 files changed, 0 insertions, 54 deletions
@@ -8,61 +8,7 @@ fi # Split the TARGET variable into three elements separated by hyphens IFS=- read -r NAME ARCH SUFFIX <<< "${TARGET}" -VERSION=${VERSION:-$(date -u +%Y%m%d)} - ORG=${ORG:-gentoo} # Push built images docker push --all-tags "${ORG}/${NAME}" - -declare -A MANIFEST_TAGS=( - [stage3:latest]="amd64-openrc;armv5tel-openrc;armv6j_hardfp-openrc;armv7a_hardfp-openrc;arm64-openrc;i686-openrc;ppc64le-openrc;rv64_lp64d-openrc;s390x" - [stage3:desktop]="amd64-desktop-openrc;arm64-desktop-openrc" - [stage3:hardened]="amd64-hardened-openrc;i686-hardened-openrc" - [stage3:hardened-nomultilib]="amd64-hardened-nomultilib-openrc" - [stage3:musl]="amd64-musl;armv7a_hardfp_musl-openrc;arm64-musl;i686-musl" - [stage3:musl-hardened]="amd64-musl-hardened;arm64-musl-hardened;ppc64le-musl-hardened-openrc" - [stage3:nomultilib]="amd64-nomultilib-openrc" - [stage3:nomultilib-systemd]="amd64-nomultilib-systemd" - [stage3:systemd]="amd64-systemd;armv5tel-systemd;armv6j_hardfp-systemd;armv7a_hardfp-systemd;arm64-systemd;i686-systemd;ppc64le-systemd;rv64_lp64d-systemd" -) - -# Find latest manifest -TAG="${ARCH}${SUFFIX:+-${SUFFIX}}" -for MANIFEST in "${!MANIFEST_TAGS[@]}"; do - if [[ "${MANIFEST_TAGS[${MANIFEST}]}" =~ (^|;)"${TAG}"(;|$) ]]; then - IFS=';' read -ra TAGS <<< "${MANIFEST_TAGS[${MANIFEST}]}" - break - fi -done -if [[ -z "${TAGS+x}" ]]; then - echo "Done! No manifests to push for TARGET=${TARGET}." - exit 0 -fi - -# Latest manifests -IMAGES=() -for TAG in "${TAGS[@]}"; do - IMAGE="${ORG}/${NAME}:${TAG}" - if docker manifest inspect "${IMAGE}" &>/dev/null; then - IMAGES+=("${IMAGE}") - fi -done - -docker manifest create "${ORG}/${MANIFEST}" "${IMAGES[@]}" -docker manifest push "${ORG}/${MANIFEST}" - -# Dated manifests -MANIFEST="${MANIFEST}-${VERSION}" -MANIFEST="${MANIFEST/:latest-/:}" # Remove "latest" tag prefix - -IMAGES=() -for TAG in "${TAGS[@]}"; do - IMAGE="${ORG}/${NAME}:${TAG}-${VERSION}" - if docker manifest inspect "${IMAGE}" &>/dev/null; then - IMAGES+=("${IMAGE}") - fi -done - -docker manifest create "${ORG}/${MANIFEST}" "${IMAGES[@]}" -docker manifest push "${ORG}/${MANIFEST}" |