Created
February 22, 2021 17:07
-
-
Save anderson-marques/38b802189bb8bc1cf37299cc60d653d4 to your computer and use it in GitHub Desktop.
TAG Untagged ECR Images
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
# This script tags a untagged ECR Images using its diggest | |
ECR_REPO=my-ecr-repo-name | |
IMAGE_DIGEST="sha256:ab6DSA4f1f940df430062009fdfb02d3ede74b48e39ada939047c2e7d0ee3ac50d8" | |
TAG=my-tag | |
# --- | |
MANIFEST=$(aws ecr batch-get-image --repository-name $ECR_REPO --image-ids imageDigest=$IMAGE_DIGEST --query 'images[].imageManifest' --output text) | |
aws ecr put-image --repository-name $ECR_REPO --image-tag $TAG --image-manifest "$MANIFEST" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment