- [Male Narrator] Whether you're using a private
or a public registry, at some point,
you're going to want to search that registry
to find the image that you need, and that's exactly
what the docker search command does for us.
If we type "man docker search," you can get
the exact command syntax for this,
and it's really very basic.
You use docker search, and you can
provide some filtering options,
and then the term that you're searching for.
So, the number of filtering options can include
the minimum of stars that an image has,
whether or not that image is being built using
an automated build, and whether or not that image
is official.
For example, from Ubuntu, or from Fedora.
Whoever created that image, the docker hub knows
the official providers of specific images.
So, here's an example of what a docker search
might look like for a Fedora image that has a minimum
number of three stars.
You should also note that any search queries you do
will return up to only 25 results by default.
You can use the dash dash limit search option
to specify a number other than 25, and that range
could be between one and a hundred.
So, let's perform some of our own searches here.
If we clear the screen, and we'll do a docker
search Ubuntu, and indeed, we get a long list
of Ubuntu images that are available for download.
What if we try a docker search dash dash limit
and set the limit to just one image.
There we go.
We get one image.
Notice that this image has 7,581 stars.
And it is the official Ubuntu Linux image.
We could also say that we want a limit of a hundred images,
and, indeed, we get a hundred images with the images
at the end, as you can see, they have zero stars.
So, the images are ranked based on the number
of stars that they have.
You can also do a search, for example,
for Ubuntu images that are official, and a filter
on is official you have to use dash dash filter and
then we'll do is dash official equals true.
So, there are the only four Ubuntu images
that are official.
We could also do Ubuntu images that have at least,
let's say, 80 stars.
So, we can go back and change this filter to stars
equal 80, and you can see there are, what is that?
One, two, three, four, five images that have at least 80
stars or more, but notice here, only two of the images
are official.
So, what if we wanted to have at least 80 stars,
and then let's do another filter and say,
is official equals true.
There we go.
There are the two up here that you saw that
have more than 80 stars and are official.
So, that's how you use the docker search command.