Last active
April 16, 2024 03:00
-
-
Save leite08/06c75a07808978ed36a33f6a20e6452c to your computer and use it in GitHub Desktop.
AWS ECR - add tag to an image by tag
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 script adds a tag to an already tag ECR Image | |
ECR_REPO=... | |
CURR_TAG=... | |
NEW_TAG=latest | |
# Can replace imageTag="$CURR_TAG" by imageDigest="sha256:..." if the image doesn't have a tag | |
MANIFEST=$(aws ecr batch-get-image --repository-name $ECR_REPO --image-ids imageTag="$CURR_TAG" --output text --query 'images[].imageManifest') | |
aws ecr put-image --repository-name $ECR_REPO --image-tag $NEW_TAG --image-manifest "$MANIFEST" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment