docker search
| Description | Search Docker Hub for images |
|---|---|
| Usage | docker search [OPTIONS] TERM |
Description
Search Docker Hub for images
Options
| Option | Default | Description |
|---|---|---|
-f, --filter | Filter output based on conditions provided | |
--format | Pretty-print search using a Go template | |
--limit | Max number of search results | |
--no-trunc | Don't truncate output |
Examples
Search images by name
This example displays images with a name containing 'busybox':
Display non-truncated description (--no-trunc)
This example displays images with a name containing 'busybox', at least 3 stars and the description isn't truncated in the output:
Limit search results (--limit)
The flag --limit is the maximum number of results returned by a search. If no
value is set, the default is set by the daemon.
Filtering (--filter)
The filtering flag (-f or --filter) format is a key=value pair. If there is more
than one filter, then pass multiple flags (e.g. --filter is-official=true --filter stars=3).
The currently supported filters are:
- stars (int - number of stars the image has)
- is-automated (boolean - true or false) - is the image automated or not (deprecated)
- is-official (boolean - true or false) - is the image official or not
stars
This example displays images with a name containing 'busybox' and at least 3 stars:
is-official
This example displays images with a name containing 'busybox', at least 3 stars and are official builds:
Format the output (--format)
The formatting option (--format) pretty-prints search output
using a Go template.
Valid placeholders for the Go template are:
| Placeholder | Description |
|---|---|
.Name | Image Name |
.Description | Image description |
.StarCount | Number of stars for the image |
.IsOfficial | "OK" if image is official |
When you use the --format option, the search command will
output the data exactly as the template declares. If you use the
table directive, column headers are included as well.
The following example uses a template without headers and outputs the
Name and StarCount entries separated by a colon (:) for all images:
This example outputs a table format: