Skip to content

Instantly share code, notes, and snippets.

@Yuyz0112
Created September 28, 2025 12:56
Show Gist options
  • Save Yuyz0112/3dc5c2e46a69ba473b96f5da2fdbb4ff to your computer and use it in GitHub Desktop.
Save Yuyz0112/3dc5c2e46a69ba473b96f5da2fdbb4ff to your computer and use it in GitHub Desktop.
#!/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