github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/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  ```bash
    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  ### 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  ```bash
    72  $ docker search --filter=stars=3 --no-trunc busybox
    73  NAME                 DESCRIPTION                                                                               STARS     OFFICIAL   AUTOMATED
    74  busybox              Busybox base image.                                                                       325       [OK]
    75  progrium/busybox                                                                                               50                   [OK]
    76  radial/busyboxplus   Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors.   8                    [OK]
    77  ```
    78  
    79  ### Limit search results (--limit)
    80  
    81  The flag `--limit` is the maximum number of results returned by a search. This value could
    82  be in the range between 1 and 100. The default value of `--limit` is 25.
    83  
    84  ### Filtering
    85  
    86  The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
    87  than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`)
    88  
    89  The currently supported filters are:
    90  
    91  - stars (int - number of stars the image has)
    92  - is-automated (boolean - true or false) - is the image automated or not
    93  - is-official (boolean - true or false) - is the image official or not
    94  
    95  #### stars
    96  
    97  This example displays images with a name containing 'busybox' and at
    98  least 3 stars:
    99  
   100  ```bash
   101  $ docker search --filter stars=3 busybox
   102  
   103  NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
   104  busybox              Busybox base image.                             325       [OK]
   105  progrium/busybox                                                     50                   [OK]
   106  radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
   107  ```
   108  
   109  #### is-automated
   110  
   111  This example displays images with a name containing 'busybox'
   112  and are automated builds:
   113  
   114  ```bash
   115  $ docker search --filter is-automated=true busybox
   116  
   117  NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
   118  progrium/busybox                                                     50                   [OK]
   119  radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
   120  ```
   121  
   122  #### is-official
   123  
   124  This example displays images with a name containing 'busybox', at least
   125  3 stars and are official builds:
   126  
   127  ```bash
   128  $ docker search --filter is-official=true --filter stars=3 busybox
   129  
   130  NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
   131  progrium/busybox                                                     50                   [OK]
   132  radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
   133  ```
   134  
   135  ### Format the output
   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  ```bash
   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  ```bash
   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  ```