github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/docs/reference/commandline/search.md (about) 1 --- 2 title: "search" 3 description: "The search command description and usage" 4 keywords: "search, hub, images" 5 --- 6 7 # search 8 9 ```markdown 10 Usage: docker search [OPTIONS] TERM 11 12 Search the Docker Hub for images 13 14 Options: 15 -f, --filter value Filter output based on conditions provided (default []) 16 - is-automated=(true|false) 17 - is-official=(true|false) 18 - stars=<number> - image has at least 'number' stars 19 --format string Pretty-print images using a Go template 20 --help Print usage 21 --limit int Max number of search results (default 25) 22 --no-trunc Don't truncate output 23 ``` 24 25 ## Description 26 27 Search [Docker Hub](https://hub.docker.com) for images 28 29 ## Examples 30 31 ### Search images by name 32 33 This example displays images with a name containing 'busybox': 34 35 ```console 36 $ docker search busybox 37 38 NAME DESCRIPTION STARS OFFICIAL AUTOMATED 39 busybox Busybox base image. 316 [OK] 40 progrium/busybox 50 [OK] 41 radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] 42 odise/busybox-python 2 [OK] 43 azukiapp/busybox This image is meant to be used as the base... 2 [OK] 44 ofayau/busybox-jvm Prepare busybox to install a 32 bits JVM. 1 [OK] 45 shingonoide/archlinux-busybox Arch Linux, a lightweight and flexible Lin... 1 [OK] 46 odise/busybox-curl 1 [OK] 47 ofayau/busybox-libc32 Busybox with 32 bits (and 64 bits) libs 1 [OK] 48 peelsky/zulu-openjdk-busybox 1 [OK] 49 skomma/busybox-data Docker image suitable for data volume cont... 1 [OK] 50 elektritter/busybox-teamspeak Lightweight teamspeak3 container based on... 1 [OK] 51 socketplane/busybox 1 [OK] 52 oveits/docker-nginx-busybox This is a tiny NginX docker image based on... 0 [OK] 53 ggtools/busybox-ubuntu Busybox ubuntu version with extra goodies 0 [OK] 54 nikfoundas/busybox-confd Minimal busybox based distribution of confd 0 [OK] 55 openshift/busybox-http-app 0 [OK] 56 jllopis/busybox 0 [OK] 57 swyckoff/busybox 0 [OK] 58 powellquiring/busybox 0 [OK] 59 williamyeh/busybox-sh Docker image for BusyBox's sh 0 [OK] 60 simplexsys/busybox-cli-powered Docker busybox images, with a few often us... 0 [OK] 61 fhisamoto/busybox-java Busybox java 0 [OK] 62 scottabernethy/busybox 0 [OK] 63 marclop/busybox-solr 64 ``` 65 66 ### <a name="no-trunc"></a> Display non-truncated description (--no-trunc) 67 68 This example displays images with a name containing 'busybox', 69 at least 3 stars and the description isn't truncated in the output: 70 71 ```console 72 $ docker search --filter=stars=3 --no-trunc busybox 73 74 NAME DESCRIPTION STARS OFFICIAL AUTOMATED 75 busybox Busybox base image. 325 [OK] 76 progrium/busybox 50 [OK] 77 radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK] 78 ``` 79 80 ### <a name="limit"></a> Limit search results (--limit) 81 82 The flag `--limit` is the maximum number of results returned by a search. This value could 83 be in the range between 1 and 100. The default value of `--limit` is 25. 84 85 ### <a name="filter"></a> Filtering (--filter) 86 87 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more 88 than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`) 89 90 The currently supported filters are: 91 92 - stars (int - number of stars the image has) 93 - is-automated (boolean - true or false) - is the image automated or not 94 - is-official (boolean - true or false) - is the image official or not 95 96 #### stars 97 98 This example displays images with a name containing 'busybox' and at 99 least 3 stars: 100 101 ```console 102 $ docker search --filter stars=3 busybox 103 104 NAME DESCRIPTION STARS OFFICIAL AUTOMATED 105 busybox Busybox base image. 325 [OK] 106 progrium/busybox 50 [OK] 107 radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] 108 ``` 109 110 #### is-automated 111 112 This example displays images with a name containing 'busybox' 113 and are automated builds: 114 115 ```console 116 $ docker search --filter is-automated=true busybox 117 118 NAME DESCRIPTION STARS OFFICIAL AUTOMATED 119 progrium/busybox 50 [OK] 120 radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] 121 ``` 122 123 #### is-official 124 125 This example displays images with a name containing 'busybox', at least 126 3 stars and are official builds: 127 128 ```console 129 $ docker search --filter is-official=true --filter stars=3 busybox 130 131 NAME DESCRIPTION STARS OFFICIAL AUTOMATED 132 busybox Busybox base image. 325 [OK] 133 ``` 134 135 ### <a name="format"></a> Format the output (--format) 136 137 The formatting option (`--format`) pretty-prints search output 138 using a Go template. 139 140 Valid placeholders for the Go template are: 141 142 | Placeholder | Description | 143 |----------------|-----------------------------------| 144 | `.Name` | Image Name | 145 | `.Description` | Image description | 146 | `.StarCount` | Number of stars for the image | 147 | `.IsOfficial` | "OK" if image is official | 148 | `.IsAutomated` | "OK" if image build was automated | 149 150 When you use the `--format` option, the `search` command will 151 output the data exactly as the template declares. If you use the 152 `table` directive, column headers are included as well. 153 154 The following example uses a template without headers and outputs the 155 `Name` and `StarCount` entries separated by a colon (`:`) for all images: 156 157 ```console 158 $ docker search --format "{{.Name}}: {{.StarCount}}" nginx 159 160 nginx: 5441 161 jwilder/nginx-proxy: 953 162 richarvey/nginx-php-fpm: 353 163 million12/nginx-php: 75 164 webdevops/php-nginx: 70 165 h3nrik/nginx-ldap: 35 166 bitnami/nginx: 23 167 evild/alpine-nginx: 14 168 million12/nginx: 9 169 maxexcloo/nginx: 7 170 ``` 171 172 This example outputs a table format: 173 174 ```console 175 $ docker search --format "table {{.Name}}\t{{.IsAutomated}}\t{{.IsOfficial}}" nginx 176 177 NAME AUTOMATED OFFICIAL 178 nginx [OK] 179 jwilder/nginx-proxy [OK] 180 richarvey/nginx-php-fpm [OK] 181 jrcs/letsencrypt-nginx-proxy-companion [OK] 182 million12/nginx-php [OK] 183 webdevops/php-nginx [OK] 184 ```