I have an image (in AWS ECR) with 2 tags and I would like to remove one tag only.
I can easily remove from my local environment using:
docker rmi <REPOSITORY>:<TAG>
I would like to remove it from ECR. Any help would be appreciated.
Here are the steps: Select the picture in question. Open the Tags pane and you should see the offending tag. Hover over the tag, and you'll see an 'X' at the right, clicking on that X will remove the tag from that picture.
Android & iOS App Find the post you wish to remove the tag from, then select the arrow next to it. Tap “Report/Remove Tag“. Select the reason. I usually just go with “I'm in this photo and I don't like it”.
Your only option for undoing the effects of removing a tag is to reapply that tag. When you're the owner of the photo you're retagging, the tag is applied immediately. If you retag a photo you didn't upload, the person whose photo you're reapplying the tag to may have to approve the tag before it's applied.
Tap the photo or video. Tap your username. Tap Remove Me From Post.
You can delete a tag using command:
aws ecr batch-delete-image --repository-name <REPO NAME> --image-ids imageTag=<TAG NAME>
I you have only one tag and execute this command then it will remove the image. If you have multiple tags for the same image, specify one and only the tag is removed.
In case one needs to delete more tags, here is a an extension of the accepted answer:
ECR_REPO="my-repo-name"
# Create a file with the list of AWS ECR tags, with one tag per line
aws ecr list-images --repository-name $ECR_REPO --filter "tagStatus=TAGGED" \
--query "imageIds[*]" --output text \
| cut -f2 > ecr-image-tags-${ECR_REPO}.txt
# For each tag, delete the image on AWS ECR
cat ecr-image-tags-${ECR_REPO}.txt | xargs -I {} \
aws ecr batch-delete-image --repository-name ${ECR_REPO} --image-ids imageTag={} | cat
You can also replace cat
by grep -E PATTERN
in the last line if you want to selectively delete tagged images with a specific pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With