Docker

How do I View Image Tags in Docker?

The Docker platform enables developers to store and use multiple versions of Docker images for project development and deployment. To store similar Docker images in the Docker registry or on the local registry, users can specify the version of the Docker image for unique identification. Thanks to the “docker tag” command that enables us to tag the Docker image to store and use similar images of different versions.

The Docker official registry “Docker Hub” contains thousands of images and also provides different versions of similar images for developer support. Its users can also view the image tag or version on the Docker hub as well as on the local machine.

This blog will demonstrate:

    • How to View Image Tags in Docker Registry?
    • How to View Image Tags on the Local System?

How to View Image Tags in Docker Registry?

To view the image tags in the Docker registry, open the Docker official registry, search for the required image of which you want to view tags, and open it. For the proper guideline, go through the provided procedure.

Step 1: Open Docker Hub Registry

First, navigate to the Docker official registry, and sign in to your Docker Hub account:


Step 2: Search Image

Search the image with the help of a highlighted search bar and open it. For instance, we have opened the “alpine” official image:


Step 3: View Tags

After that, click on the “Tags” menu to view all tags of the image:


Upon doing so, the tags list of the selected image will be displayed:


Alternatively, users can view the tags from the command line with the help of the provided command. Here, “jq” is a program that is used to process JSON inputs:

> curl 'https://registry.hub.docker.com/v2/repositories/library/alpine/tags/'|jq '."results"[]["name"]'

 
Note: The “curl” command is basically a Linux command line utility. To use the curl command on Windows, you can follow our associated article.

How to View Image Tags on Local System?

To view the tags of local images or user’s defined images on the system in Docker, go through the provided examples.

Example 1: List All Images to View Tag

To view detailed information about images, list down all images with the help of the “docker images” command:

> docker images

 
From the below output, you can view all tags of the listed images:


Example 2: View Images in Specific Format

You can also list down images in specific format to view the tags only with the help of the “–format” option. For instance, we have defined the format to view the image name or repository and tags:

> docker images --format "table {{.Repository}}\t{{.Tag}}"

 

Example 3: View All Tags of Specific Image

However, to view the tags of a specific image or selected image, look at provided command:

> docker images python --format "table {{.Repository}}\t{{.Tag}}"

 

We have compiled different methods to view tags of images in Docker.

Conclusion

Users can view the tag of official images from the Docker registry. For this purpose, navigate to the official registry and open the image of which you want to view all tags. Then, visit the “Tags” menu. However, to view the tags of local images on the system, use the “docker images” command. This write-up has demonstrated the approaches to view the image tags in Docker.

About the author

Rafia Zafar

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.