Filter search results by stars and official status
In this step, you will learn how to filter the search results based on criteria like the number of stars and whether the image is official. This helps you find more relevant and trustworthy images.
You can use the --filter
option to apply filters to your search. The --filter
option takes a key=value pair.
To filter by the number of stars, use the stars
key followed by the minimum number of stars you want. For example, to find Ubuntu images with at least 1000 stars, run:
docker search --filter stars=1000 ubuntu
Observe the output. You should now only see Ubuntu images that have 1000 or more stars.
You can also filter for official images using the is-official
key with a value of true
. Official images are maintained by Docker or the original software vendors and are generally considered more reliable.
To find official Ubuntu images, use the following command:
docker search --filter is-official=true ubuntu
The output will show only the official Ubuntu images.
You can combine multiple filters by using the --filter
option multiple times. For example, to find official Ubuntu images with at least 1000 stars, you would use:
docker search --filter is-official=true --filter stars=1000 ubuntu
This command will narrow down the results to only show official Ubuntu images that have received at least 1000 stars.