2016-10-14 18:30:36 -04:00
|
|
|
---
|
|
|
|
title: "search"
|
|
|
|
description: "The search command description and usage"
|
2016-11-03 18:48:30 -04:00
|
|
|
keywords: "search, hub, images"
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2015-06-21 16:41:38 -04:00
|
|
|
|
2017-10-04 13:03:55 -04:00
|
|
|
<!-- This file is maintained within the docker/cli GitHub
|
2017-07-28 13:28:23 -04:00
|
|
|
repository at https://github.com/docker/cli/. Make all
|
2016-10-19 13:25:45 -04:00
|
|
|
pull requests against that repo. If you see this file in
|
|
|
|
another repository, consider it read-only there, as it will
|
|
|
|
periodically be overwritten by the definitive file. Pull
|
|
|
|
requests which include edits to this file in other repositories
|
|
|
|
will be rejected.
|
|
|
|
-->
|
|
|
|
|
2015-06-21 16:41:38 -04:00
|
|
|
# search
|
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
```markdown
|
|
|
|
Usage: docker search [OPTIONS] TERM
|
|
|
|
|
|
|
|
Search the Docker Hub for images
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-f, --filter value Filter output based on conditions provided (default [])
|
|
|
|
- is-automated=(true|false)
|
|
|
|
- is-official=(true|false)
|
|
|
|
- stars=<number> - image has at least 'number' stars
|
2017-08-15 06:58:49 -04:00
|
|
|
--format string Pretty-print images using a Go template
|
2016-07-07 14:43:18 -04:00
|
|
|
--help Print usage
|
|
|
|
--limit int Max number of search results (default 25)
|
|
|
|
--no-trunc Don't truncate output
|
|
|
|
```
|
2015-06-21 16:41:38 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Description
|
|
|
|
|
2015-12-02 08:40:44 -05:00
|
|
|
Search [Docker Hub](https://hub.docker.com) for images
|
|
|
|
|
2016-10-20 09:52:47 -04:00
|
|
|
See [*Find Public Images on Docker Hub*](https://docs.docker.com/engine/tutorials/dockerrepos/#searching-for-images) for
|
2015-12-02 08:40:44 -05:00
|
|
|
more details on finding shared images from the command line.
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
> **Note**: Search queries return a maximum of 25 results.
|
2015-12-02 08:40:44 -05:00
|
|
|
|
2015-10-23 06:32:23 -04:00
|
|
|
## Examples
|
|
|
|
|
2015-12-02 08:40:44 -05:00
|
|
|
### Search images by name
|
|
|
|
|
|
|
|
This example displays images with a name containing 'busybox':
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
```none
|
|
|
|
$ docker search busybox
|
|
|
|
|
|
|
|
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
|
|
|
|
busybox Busybox base image. 316 [OK]
|
|
|
|
progrium/busybox 50 [OK]
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
|
|
|
|
odise/busybox-python 2 [OK]
|
|
|
|
azukiapp/busybox This image is meant to be used as the base... 2 [OK]
|
|
|
|
ofayau/busybox-jvm Prepare busybox to install a 32 bits JVM. 1 [OK]
|
|
|
|
shingonoide/archlinux-busybox Arch Linux, a lightweight and flexible Lin... 1 [OK]
|
|
|
|
odise/busybox-curl 1 [OK]
|
|
|
|
ofayau/busybox-libc32 Busybox with 32 bits (and 64 bits) libs 1 [OK]
|
|
|
|
peelsky/zulu-openjdk-busybox 1 [OK]
|
|
|
|
skomma/busybox-data Docker image suitable for data volume cont... 1 [OK]
|
|
|
|
elektritter/busybox-teamspeak Lightweight teamspeak3 container based on... 1 [OK]
|
|
|
|
socketplane/busybox 1 [OK]
|
|
|
|
oveits/docker-nginx-busybox This is a tiny NginX docker image based on... 0 [OK]
|
|
|
|
ggtools/busybox-ubuntu Busybox ubuntu version with extra goodies 0 [OK]
|
|
|
|
nikfoundas/busybox-confd Minimal busybox based distribution of confd 0 [OK]
|
|
|
|
openshift/busybox-http-app 0 [OK]
|
|
|
|
jllopis/busybox 0 [OK]
|
|
|
|
swyckoff/busybox 0 [OK]
|
|
|
|
powellquiring/busybox 0 [OK]
|
|
|
|
williamyeh/busybox-sh Docker image for BusyBox's sh 0 [OK]
|
|
|
|
simplexsys/busybox-cli-powered Docker busybox images, with a few often us... 0 [OK]
|
|
|
|
fhisamoto/busybox-java Busybox java 0 [OK]
|
|
|
|
scottabernethy/busybox 0 [OK]
|
|
|
|
marclop/busybox-solr
|
|
|
|
```
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2016-05-20 07:41:28 -04:00
|
|
|
### 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:
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
```bash
|
2019-08-29 13:35:28 -04:00
|
|
|
$ docker search --filter=stars=3 --no-trunc busybox
|
2017-02-07 18:42:48 -05:00
|
|
|
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
|
|
|
|
busybox Busybox base image. 325 [OK]
|
|
|
|
progrium/busybox 50 [OK]
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK]
|
|
|
|
```
|
2016-05-20 07:41:28 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
### Limit search results (--limit)
|
2016-06-01 16:38:14 -04:00
|
|
|
|
2016-10-19 13:25:45 -04:00
|
|
|
The flag `--limit` is the maximum number of results returned by a search. This value could
|
2016-06-01 16:38:14 -04:00
|
|
|
be in the range between 1 and 100. The default value of `--limit` is 25.
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
### Filtering
|
2016-05-20 07:41:28 -04:00
|
|
|
|
|
|
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
2019-08-01 08:04:39 -04:00
|
|
|
than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`)
|
2016-05-20 07:41:28 -04:00
|
|
|
|
|
|
|
The currently supported filters are:
|
|
|
|
|
|
|
|
* stars (int - number of stars the image has)
|
2017-07-13 04:30:44 -04:00
|
|
|
* is-automated (boolean - true or false) - is the image automated or not
|
|
|
|
* is-official (boolean - true or false) - is the image official or not
|
2016-05-20 07:41:28 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
#### stars
|
2015-12-02 08:40:44 -05:00
|
|
|
|
|
|
|
This example displays images with a name containing 'busybox' and at
|
|
|
|
least 3 stars:
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
```bash
|
|
|
|
$ docker search --filter stars=3 busybox
|
|
|
|
|
|
|
|
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
|
|
|
|
busybox Busybox base image. 325 [OK]
|
|
|
|
progrium/busybox 50 [OK]
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
|
|
|
|
```
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
#### is-automated
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2016-05-20 07:41:28 -04:00
|
|
|
This example displays images with a name containing 'busybox'
|
|
|
|
and are automated builds:
|
2015-12-02 08:40:44 -05:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
```bash
|
2019-08-01 08:04:39 -04:00
|
|
|
$ docker search --filter is-automated=true busybox
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
|
|
|
|
progrium/busybox 50 [OK]
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
|
|
|
|
```
|
|
|
|
|
|
|
|
#### is-official
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2016-05-20 07:41:28 -04:00
|
|
|
This example displays images with a name containing 'busybox', at least
|
|
|
|
3 stars and are official builds:
|
2015-12-02 08:40:44 -05:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
```bash
|
2019-08-01 08:04:39 -04:00
|
|
|
$ docker search --filter is-official=true --filter stars=3 busybox
|
2017-02-07 18:42:48 -05:00
|
|
|
|
|
|
|
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
|
|
|
|
progrium/busybox 50 [OK]
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
|
|
|
|
```
|
2017-08-15 06:58:49 -04:00
|
|
|
|
|
|
|
### Format the output
|
|
|
|
|
|
|
|
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 |
|
|
|
|
| `.IsAutomated` | "OK" if image build was automated |
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
{% raw %}
|
|
|
|
$ docker search --format "{{.Name}}: {{.StarCount}}" nginx
|
|
|
|
|
|
|
|
nginx: 5441
|
|
|
|
jwilder/nginx-proxy: 953
|
|
|
|
richarvey/nginx-php-fpm: 353
|
|
|
|
million12/nginx-php: 75
|
|
|
|
webdevops/php-nginx: 70
|
|
|
|
h3nrik/nginx-ldap: 35
|
|
|
|
bitnami/nginx: 23
|
|
|
|
evild/alpine-nginx: 14
|
|
|
|
million12/nginx: 9
|
|
|
|
maxexcloo/nginx: 7
|
|
|
|
{% endraw %}
|
|
|
|
```
|
|
|
|
|
|
|
|
This example outputs a table format:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
{% raw %}
|
|
|
|
$ docker search --format "table {{.Name}}\t{{.IsAutomated}}\t{{.IsOfficial}}" nginx
|
|
|
|
|
|
|
|
NAME AUTOMATED OFFICIAL
|
|
|
|
nginx [OK]
|
|
|
|
jwilder/nginx-proxy [OK]
|
|
|
|
richarvey/nginx-php-fpm [OK]
|
|
|
|
jrcs/letsencrypt-nginx-proxy-companion [OK]
|
|
|
|
million12/nginx-php [OK]
|
|
|
|
webdevops/php-nginx [OK]
|
|
|
|
{% endraw %}
|
|
|
|
```
|