Skip to content

Instantly share code, notes, and snippets.

@anderson-marques
Created February 22, 2021 17:07
Show Gist options
  • Save anderson-marques/38b802189bb8bc1cf37299cc60d653d4 to your computer and use it in GitHub Desktop.
Save anderson-marques/38b802189bb8bc1cf37299cc60d653d4 to your computer and use it in GitHub Desktop.
TAG Untagged ECR Images
# 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