Docker

How to Use Docker Hub to Search for Images

Docker Hub is used to manage the sharing and storage of Docker images as it is an open source, and scalable server-side application. Docker Hub provides a secure and easy-to-use environment to access different applications. Developers can access it as public, create their own private repository space, and automate applications to build work groups by using Docker.

The outcomes of this guide are:

How to Use Docker Hub to Search for Images

To use the Docker Hub for searching images, follow the below-mentioned instructions.

First, open your favorite web browser, move to the Docker Hub, and sign in with your account:

Then, provide the required information in the given fields and hit the Continue button:

After doing so, you will log in to your Docker Hub account. Now, specify the desired Docker image name in the fields and then click on the Enter button. In our case, we have searched for the Ubuntu image:

As a result, you will get the image details on your screen. Now, you can download it by executing the docker push <image-name:tag> command on your local machine:

How to Search for Images from Docker Hub through CLI

Another way to search the image from Docker Hub is through the CLI. To do so, first, you need to log in with Docker by executing the below-provided command:

docker login

Then, use the docker search command to search the Ubuntu images:

docker search ubuntu

After executing the above-mentioned command, you will get the list of images with the same name along with the parameters like image name, description, stars, and automated parameters that suggest that you can build the images automatically using the different forums:

You can also filter your search by using the –filter option based on STARS. For instance, we want to search the Ubuntu image which has a minimum of 20 stars with the help of the following command:

docker search --filter=stars=20 ubuntu

To filter the search based on whether the Docker built-in image is being used as automated or with the help of the following command:

docker search --filter=is-automated=true ngnix

Here:

  • –filter flag used for retrieving the output which is based on the provided condition.
  • ngnix is our desired Docker image with the true value of the automated filter.

As a result, we get the three ngnix images:

That’s it! We have described the usage of the Docker Hub for searching the built-in images.

Conclusion

To search the Docker images by using the Docker Hub registry, first, login to your Docker Hub account, and access the Repositories tab. After that search the desired image in the search bar. Another way to get the built-in images is by executing different commands, such as the “docker search <image-name>”, “docker search –filter=stars=<num> <img-name>” and “docker search –filter=is-automated=true <img-name>” commands. This guide provides the easiest way to search the images by using the Docker hub.

About the author

Maria Naz

I hold a master's degree in computer science. I am passionate about my work, exploring new technologies, learning programming languages, and I love to share my knowledge with the world.