2015-06-21 16:41:38 -04:00
|
|
|
# search
|
|
|
|
|
2023-01-06 13:04:05 -05:00
|
|
|
<!---MARKER_GEN_START-->
|
2022-03-29 05:24:51 -04:00
|
|
|
Search Docker Hub for images
|
2016-07-07 14:43:18 -04:00
|
|
|
|
2023-01-06 13:04:05 -05:00
|
|
|
### Options
|
|
|
|
|
|
|
|
| Name | Type | Default | Description |
|
|
|
|
|:---------------------------------------|:---------|:--------|:-------------------------------------------|
|
|
|
|
| [`-f`](#filter), [`--filter`](#filter) | `filter` | | Filter output based on conditions provided |
|
|
|
|
| [`--format`](#format) | `string` | | Pretty-print search using a Go template |
|
|
|
|
| [`--limit`](#limit) | `int` | `0` | Max number of search results |
|
2024-07-03 02:29:57 -04:00
|
|
|
| [`--no-trunc`](#no-trunc) | `bool` | | Don't truncate output |
|
2023-01-06 13:04:05 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!---MARKER_GEN_END-->
|
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
|
|
|
|
|
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
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-02-07 18:42:48 -05:00
|
|
|
$ docker search busybox
|
|
|
|
|
2023-07-10 14:18:28 -04:00
|
|
|
NAME DESCRIPTION STARS OFFICIAL
|
2020-03-15 10:11:43 -04:00
|
|
|
busybox Busybox base image. 316 [OK]
|
2023-07-10 14:18:28 -04:00
|
|
|
progrium/busybox 50
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8
|
|
|
|
odise/busybox-python 2
|
|
|
|
azukiapp/busybox This image is meant to be used as the base... 2
|
|
|
|
ofayau/busybox-jvm Prepare busybox to install a 32 bits JVM. 1
|
|
|
|
shingonoide/archlinux-busybox Arch Linux, a lightweight and flexible Lin... 1
|
|
|
|
odise/busybox-curl 1
|
|
|
|
ofayau/busybox-libc32 Busybox with 32 bits (and 64 bits) libs 1
|
|
|
|
peelsky/zulu-openjdk-busybox 1
|
|
|
|
skomma/busybox-data Docker image suitable for data volume cont... 1
|
|
|
|
elektritter/busybox-teamspeak Lightweight teamspeak3 container based on... 1
|
|
|
|
socketplane/busybox 1
|
|
|
|
oveits/docker-nginx-busybox This is a tiny NginX docker image based on... 0
|
|
|
|
ggtools/busybox-ubuntu Busybox ubuntu version with extra goodies 0
|
|
|
|
nikfoundas/busybox-confd Minimal busybox based distribution of confd 0
|
|
|
|
openshift/busybox-http-app 0
|
|
|
|
jllopis/busybox 0
|
|
|
|
swyckoff/busybox 0
|
|
|
|
powellquiring/busybox 0
|
|
|
|
williamyeh/busybox-sh Docker image for BusyBox's sh 0
|
|
|
|
simplexsys/busybox-cli-powered Docker busybox images, with a few often us... 0
|
|
|
|
fhisamoto/busybox-java Busybox java 0
|
|
|
|
scottabernethy/busybox 0
|
2017-02-07 18:42:48 -05:00
|
|
|
marclop/busybox-solr
|
|
|
|
```
|
2015-10-23 06:32:23 -04:00
|
|
|
|
2023-01-06 13:28:29 -05:00
|
|
|
### <a name="no-trunc"></a> Display non-truncated description (--no-trunc)
|
2016-05-20 07:41:28 -04:00
|
|
|
|
|
|
|
This example displays images with a name containing 'busybox',
|
|
|
|
at least 3 stars and the description isn't truncated in the output:
|
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2019-08-29 13:35:28 -04:00
|
|
|
$ docker search --filter=stars=3 --no-trunc busybox
|
2021-08-21 08:54:14 -04:00
|
|
|
|
2023-07-10 14:18:28 -04:00
|
|
|
NAME DESCRIPTION STARS OFFICIAL
|
2020-03-15 10:11:43 -04:00
|
|
|
busybox Busybox base image. 325 [OK]
|
2023-07-10 14:18:28 -04:00
|
|
|
progrium/busybox 50
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8
|
2017-02-07 18:42:48 -05:00
|
|
|
```
|
2016-05-20 07:41:28 -04:00
|
|
|
|
2023-01-06 13:28:29 -05:00
|
|
|
### <a name="limit"></a> Limit search results (--limit)
|
2016-06-01 16:38:14 -04:00
|
|
|
|
2022-03-15 10:06:35 -04:00
|
|
|
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.
|
2016-06-01 16:38:14 -04:00
|
|
|
|
2023-01-06 13:28:29 -05:00
|
|
|
### <a name="filter"></a> Filtering (--filter)
|
2016-05-20 07:41:28 -04:00
|
|
|
|
|
|
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
2023-12-13 18:06:16 -05:00
|
|
|
than one filter, then pass multiple flags (e.g. `--filter is-official=true --filter stars=3`).
|
2016-05-20 07:41:28 -04:00
|
|
|
|
|
|
|
The currently supported filters are:
|
|
|
|
|
2020-04-19 09:43:08 -04:00
|
|
|
- stars (int - number of stars the image has)
|
2023-07-10 14:18:28 -04:00
|
|
|
- is-automated (boolean - true or false) - is the image automated or not (deprecated)
|
2020-04-19 09:43:08 -04:00
|
|
|
- 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
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-02-07 18:42:48 -05:00
|
|
|
$ docker search --filter stars=3 busybox
|
|
|
|
|
2023-07-10 14:18:28 -04:00
|
|
|
NAME DESCRIPTION STARS OFFICIAL
|
2020-03-15 10:11:43 -04:00
|
|
|
busybox Busybox base image. 325 [OK]
|
2023-07-10 14:18:28 -04:00
|
|
|
progrium/busybox 50
|
|
|
|
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8
|
2017-02-07 18:42:48 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
#### 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
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
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
|
|
|
|
2023-07-10 14:18:28 -04:00
|
|
|
NAME DESCRIPTION STARS OFFICIAL
|
2021-09-29 23:45:59 -04:00
|
|
|
busybox Busybox base image. 325 [OK]
|
2017-02-07 18:42:48 -05:00
|
|
|
```
|
2017-08-15 06:58:49 -04:00
|
|
|
|
2023-01-06 13:28:29 -05:00
|
|
|
### <a name="format"></a> Format the output (--format)
|
2017-08-15 06:58:49 -04:00
|
|
|
|
|
|
|
The formatting option (`--format`) pretty-prints search output
|
|
|
|
using a Go template.
|
|
|
|
|
|
|
|
Valid placeholders for the Go template are:
|
|
|
|
|
2023-07-10 14:18:28 -04:00
|
|
|
| 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 (deprecated) |
|
2017-08-15 06:58:49 -04:00
|
|
|
|
|
|
|
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
|
2020-04-19 11:23:09 -04:00
|
|
|
`Name` and `StarCount` entries separated by a colon (`:`) for all images:
|
2017-08-15 06:58:49 -04:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-08-15 06:58:49 -04:00
|
|
|
$ 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
|
|
|
|
```
|
|
|
|
|
|
|
|
This example outputs a table format:
|
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2023-07-10 14:18:28 -04:00
|
|
|
$ docker search --format "table {{.Name}}\t{{.IsOfficial}}" nginx
|
|
|
|
|
|
|
|
NAME OFFICIAL
|
|
|
|
nginx [OK]
|
|
|
|
jwilder/nginx-proxy
|
|
|
|
richarvey/nginx-php-fpm
|
|
|
|
jrcs/letsencrypt-nginx-proxy-companion
|
|
|
|
million12/nginx-php
|
|
|
|
webdevops/php-nginx
|
2017-08-15 06:58:49 -04:00
|
|
|
```
|