Delete only selected tags from the Container Registry
Problem to solve
The GitLab Container Registry allows users to build, push and share Docker images/tags using the Docker client, GitLab CI or the GitLab API.
At /container_registry
users can view and manage their images/tags. However, if an image has multiple tags, clicking delete on any of the tags deletes all tags with the same image id. This is due to a limitation with the Docker API, which does not allow for the deletion of a single tag. The issue has been raised with Docker, but has not been addressed in over two years.
This is problematic for users that expect to be able to delete a single tag and end up accidentally deleting multiple tags. Several users have suggested workarounds for this problem, but we have yet to incorporate any of them into the GitLab UI.
Example
I've clicked 'delete' on line with Name
= 5ede343b167a188a8349fc7594389c9c725cecab
:
Intended users
Proposal
Update the container registry UI, to allow users to remove a single tag, without removing all tags with the same TagID
.
- Since Docker distribution deletes all tags which point to same image, we can delete just one tag by pushing a different image into it and then deleting the tag.
- When the tag is the last tag for the image, do not apply the substitution, delete the actual image and not the dummy
Further details
Community Contributions
- https://gitlab.com/gitlab-org/gitlab-ce/issues/21405#note_66291640
- https://gitlab.com/gitlab-org/gitlab-ce/issues/21405#note_144535095
- https://github.com/glensc/docker-create-tag
UX considerations
- https://gitlab.com/gitlab-org/gitlab-ce/issues/24705 will give users the ability to select and remove multiple images/tags at once. As part of that change, it's important that only images/tags that are selected are removed.
- https://gitlab.com/gitlab-org/gitlab-ce/issues/62559 added a warning modal, which can be removed if we address this issue.
Permissions and Security
- Developers, maintainers, and owners will all have the ability to untag multiple images/tags.
- For the Container Registry API we do not allow developers to bulk delete images, but since they are manually selecting the images, we can allow it.
Documentation
Testing
- We need to test that the untagging behavior works as expected and that only items selected are removed.
What does success look like, and how can we measure that?
Success looks like we have resolved the core issue and users can begin to rely on the user interface for managing their Container Registry. Once resolved, we should see an increase in the amount of images that are untagged.
Metrics
Priority | Category | Metric | Aggregated by | SMAU Eligible? | Data available? |
---|---|---|---|---|---|
P1 | Container Registry | # of page views of /container registry
|
|
Yes | ? |
P1 | Container Registry | # of images/tags deleted one at a time from the UI |
|
Yes | ? |
P1 | Container Registry | # of images/tags deleted in bulk from the UI |
|
Yes | ? |