Last Updated on 2 months by Sachin G
Docker, a popular containerization platform, provides a powerful command-line interface for managing containers and images. Container images are generally stored in image registries. Distribute through public or private users. Image registries share container images to download. You can configure registries for search.
Registries are repositories that store images, making them accessible for deployment
In different environments. Docker Hub is one of the most popular and mostly used public registries,
It has a huge collection of pre-built container images.
One essential aspect of working is the ability to search for container images in registries. In this topic, I am going to check the search command, which finds images in different image registries and filters through image name, user name, or according and the rating stars.
The syntax for the search command is shown below:
# docker search [OPTIONS] TERM
container search will search in the docker hub or container registries, which you configured in the registries configuration file.
Below search commands will use some useful for the search subcommand:
1. Docker Search by container name:
Below commands will search images with a name containing ‘Nginx’. I am showing examples with Nginx container name. You can modify it according to you.
# docker search nginx
2 . Docker Limit Search
This option will search or list images per registry. For example, if we have a number of registries available then a limited number of images will show per registry. –limit option will show results per registry’s given limit.
# docker search --limit=<number> container_name
The result below shows the command search for the Nginx container in a different registry. Eg: the fedora project, dockerio, etc. It is limited to two projects.
3. –filter option –filter <filter=value>
this will filter output based on sub-option command filters :
a . –filter stars
This will filter container registery according to stars which has.
# docker search --filter stars=4 nginx
b. –filter is-official
This condition will show only those images that are official images.
# docker search --filter is-official=true nginx
c. –filter is-automated=true/false
# docker search --filter is-automated=true nginx
Searching for container images in Docker registries is an important step in the software development and deployment process. With the Docker command-line interface, users can quickly search, evaluate, and retrieve images from both public and private registries. By taking advantage of the Docker search command and its various options, developers can streamline the process of finding the right container images for their projects. Here is another topic for Setup & Configure Mysql Container, click here.
I am a professional freelance contributor and the founder of Tech Transit. I hold certifications in Linux, Ansible, and OpenShift from Red Hat, as well as CPanel and ITIL certifications. With a passion for education, culture, and community, I love writing and sharing knowledge. Since 2009, I’ve been actively using, setting up, supporting, and maintaining Linux systems. Linux truly rocks!