Working With Tags

Image tags have a function similar to those of the branch refs in Git: pointing to a state of the artifact at a specific time. Originally, the purpose of image tags was to differentiate between multiple versions of the same image. But more often than not different tags may refer to the same image.

The tags come in handy when you want to pull and run an image. SHA256 hashes – the native identifiers of the Docker images and their versions – are difficult to read and impossible to memorize. Tags replace them in a way and help to spot the image you need quickly and refer to it in a more human way.

Contrary to the labels, tags are not only visible inside your Container Registry project but they remain “attached” to the image after it is pulling from the repository and as long as they are not removed using the Container registry GUI or a command line tool.

Managing Tags

Overview of the Image Tags

You can check which tags are assigned to an image using one of the methods:

  • Inside the repository, in the artifacts list, hover over the entry in the Tags column to make the following popup message appear:

  • In the artifact view, you can see all tags in the Tags table:

Adding New Tags / Tagging Images

You can add tags to image versions inside the Container Registry GUI. Since you are not building the image at this moment, the old tag and the new tag will refer to the same image. It may make sense, though, if you want to tag the latest image which has a default “latest” tag to make it more catchy and easy to find.

  • In the artifact view, select the tags you want to use for the new tag using checkboxes;
  • Click + ADD TAG and type in the new tag.

INFO

If you try to tag an artifact with the tag that already exists in the same repository, the error message will appear and you will need to select another tag:

Retagging Images

Retagging images in the Container Registry GUI is different from adding tags since it copies the artifact into another repository and/or project.

To retag an artifact:

  • In the artifacts list inside the repository, select an artifact using the checkbox;
  • Go to Actions;
  • Click Copy;

  • Specify the destination:
    • Start typing the project name to retrieve a dropdown;


Prerequisites

In the source repository, you need at least guest access which is read access; in the target repository, you need at least developer access or above to have writer permissions.


Removing Tags / Detagging Images

INFO

Removing tags in the Container Registry GUI is different from removing tags using docker rmi command in a command line tool. Even if you remove all tags, the image – the artifact – won’t be deleted.

To remove one or more tags:

  • In the artifact view, tick the checkboxes of the tags you want to remove;
  • Click REMOVE TAG;

  • Confirm that you want them removed.