0
votes

According to https://docs.aws.amazon.com/AmazonECR/latest/userguide/retag-aws-cli.html, it describe how to retagging exist image's tag.

So I tried to execute command.

  1. MANIFEST=$(aws ecr batch-get-image --repository-name test --image-ids imageTag=latest --query 'images[].imageManifest' --output text)

  2. aws ecr put-image --repository-name test --image-tag old-version --image-manifest "$MANIFEST"

(This command find image that has latest and changed it to old-version)

Expected re-named tag is old-version.

But when I checked in ECR, it has both latest and old-version.

How can I delete latest tag and give it to old-version tag only?

1

1 Answers

0
votes

Run the command:

aws ecr batch-delete-image --repository-name test --image-ids imageTag=latest