Created
September 28, 2025 12:56
-
-
Save Yuyz0112/3dc5c2e46a69ba473b96f5da2fdbb4ff to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| TARGET_REGISTRY="192.168.1.38" | |
| TARGET_REPO="neutree-ai" | |
| images=$(docker image ls --format "{{.Repository}}:{{.Tag}}") | |
| for image in $images; do | |
| image_name=$(echo $image | cut -d':' -f1) | |
| image_tag=$(echo $image | cut -d':' -f2) | |
| target_image="${TARGET_REGISTRY}/${TARGET_REPO}/${image_name}:${image_tag}" | |
| echo "Tagging image: $image as $target_image" | |
| docker tag "$image" "$target_image" | |
| echo "Pushing image: $target_image" | |
| docker push "$target_image" | |
| done | |
| echo "All images have been tagged and pushed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment