aws / aws/containers-roadmap

[ECR Public] ECR request: allow deleting image tags without deleting image

Open
#1,567 0 comments 45 reactions 0 assignees View on GitHub
ECR ECR Public Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**

A way to delete _tags_ by themselves from ECR and ECR public, but not forcing the deletion of the images those tags point to.

Currently, if an image has multiple tags, you can delete one of tags by running something like:

```sh
$ aws ecr-public batch-delete-image --repository-name $REPO --image-ids imageTag=$TAG
```

However, if the image only has that tag, then the image itself is deleted from the registry. This is logical most of the time, however sometimes a tag points to an image that is referenced by a manifest list. In this case, the tag should be deleted as requested but the image left in place because of the reference in the manifest list.

The actual behaviour is that if the image only has one tag, and is also referenced in a manifest list, then the tag cannot be deleted due to this reference.

**Which service(s) is this request for?**
ECR and ECR Public

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Push multiple single-architecture docker images to a named tag, then use `docker manifest create` and `docker manifest push` to create and push a manifest list referencing those images (aka multi-arch image/manifest), then delete the tag(s) used for the single-arch images as they are no longer needed.

**Are you currently working around this issue?**
Once the manifest list is created, pointing at the single-arch images, push a random image that we don't want to the same tag(s) used for the single-arch images, then use the `aws ecr-public batch-delete` command to delete the tag alongside the random image we pushed solely for the purpose of being able to delete the tag.

**Additional context**
It would be great if ECR treated _tags_ as first-class objects that could be manipulated/deleted independently of the images that they point to.

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are identified. Start by reviewing the `aws ecr-public batch-delete-image` behavior and the `docker manifest create` and `docker manifest push` workflow described here. Done means a tag can be deleted independently while an image referenced by a manifest list remains available in both ECR and ECR Public.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, shell
Domain
cloud, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.