Created
April 18, 2023 02:27
-
-
Save paulhauner/2791c44cac848b23dbb95a30c4f09453 to your computer and use it in GitHub Desktop.
retag-lighthouse-docker-images.fish
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
# This fish script will re-tag all the $SRC_TAG_PREFIX images with the | |
# $DEST_TAG_PREFIX and push those images to Dockerhub. | |
# | |
# This script is specifically designed for the github.com/sigp/lighthouse | |
# repos, as they exist in April 2023. | |
# | |
# Be sure to double check the images after you've pushed them, especially the | |
# mainfests. I ran this script twice because I kept pulling outdated manifests, | |
# I'm not sure if that's a caching issue or if the script needs to be run | |
# twice. Running it twice shouldn't hurt. | |
set REPO sigp/lighthouse | |
set SRC_TAG_PREFIX v4.0.2-rc.0 | |
set DEST_TAG_PREFIX latest | |
# Update all the (non-manifest) images. | |
set SUFFIXES "-amd64" "-amd64-dev" "-amd64-modern" "-amd64-modern-dev" "-arm64" "-arm64-dev" "-arm64-modern" "-arm64-dev" | |
for SUFFIX in $SUFFIXES | |
set SRC_TAG $REPO:$SRC_TAG_PREFIX$SUFFIX | |
docker pull $SRC_TAG | |
set DEST_TAG $REPO:$DEST_TAG_PREFIX$SUFFIX | |
docker tag $SRC_TAG $DEST_TAG | |
docker push $DEST_TAG | |
end | |
# Update all the manifests. | |
set MANIFEST_SUFFIXES "" "-modern" | |
for SUFFIX in $MANIFEST_SUFFIXES | |
set DEST_MANIFEST $REPO:$DEST_TAG_PREFIX$SUFFIX | |
docker manifest create $DEST_MANIFEST \ | |
--amend $REPO:$DEST_TAG_PREFIX-arm64$SUFFIX \ | |
--amend $REPO:$DEST_TAG_PREFIX-amd64$SUFFIX; | |
docker manifest push $DEST_MANIFEST | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment