diff --git a/.github/workflows/docker-tag-push.yml b/.github/workflows/docker-tag-push.yml index 450dee0ae5..38ea9f3a16 100644 --- a/.github/workflows/docker-tag-push.yml +++ b/.github/workflows/docker-tag-push.yml @@ -52,6 +52,9 @@ jobs: path: /tmp/jupyter/tags/ - name: Apply tags to the loaded image 🏷 run: python3 -m tagging.apply_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/ --platform ${{ inputs.platform }} --registry ${{ env.REGISTRY }} --owner ${{ env.OWNER }} + # This step is needed to prevent pushing non-multiarch "latest" tag + - name: Remove "latest" tag from the image 🗑️ + run: docker image rmi ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }}:latest - name: Push Images to Registry 📤 if: env.PUSH_TO_REGISTRY == 'true' diff --git a/tagging/apply_tags.py b/tagging/apply_tags.py index 784cd778e0..72634227f9 100755 --- a/tagging/apply_tags.py +++ b/tagging/apply_tags.py @@ -23,7 +23,6 @@ def apply_tags( ) -> None: """ Tags //:latest with the tags reported by all taggers for this image - Then removes latest tag """ LOGGER.info(f"Tagging image: {short_image_name}") @@ -35,9 +34,6 @@ def apply_tags( LOGGER.info(f"Applying tag: {tag}") docker["tag", image, tag] & plumbum.FG - LOGGER.info("Removing latest tag from the image") - docker["image", "rmi", image] & plumbum.FG - if __name__ == "__main__": logging.basicConfig(level=logging.INFO)