Skip to content

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

image

I've clicked 'delete' on line with Name = 5ede343b167a188a8349fc7594389c9c725cecab:

image

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

UX considerations

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
  • Time: day/week/month/quarter/year
  • Instance: Self-managed CE/Self-managed EE
  • Account type: Core/Starter/Premium/Ultimate
Yes ?
P1 Container Registry # of images/tags deleted one at a time from the UI
  • Time: day/week/month/quarter/year
  • Instance: Self-managed CE/Self-managed EE
  • Account type: Core/Starter/Premium/Ultimate
Yes ?
P1 Container Registry # of images/tags deleted in bulk from the UI
  • Time: day/week/month/quarter/year
  • Instance: Self-managed CE/Self-managed EE
  • Account type: Core/Starter/Premium/Ultimate
Yes ?

Links / references

Edited by Tim Rizzi