github.com/rsampaio/docker@v0.7.2-0.20150827203920-fdc73cc3fc31/docs/reference/commandline/images.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "images"
     4  description = "The images command description and usage"
     5  keywords = ["list, docker, images"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  weight=1
     9  +++
    10  <![end-metadata]-->
    11  
    12  # images
    13  
    14      Usage: docker images [OPTIONS] [REPOSITORY[:TAG]]
    15  
    16      List images
    17  
    18        -a, --all=false      Show all images (default hides intermediate images)
    19        --digests=false      Show digests
    20        -f, --filter=[]      Filter output based on conditions provided
    21        --help=false         Print usage
    22        --no-trunc=false     Don't truncate output
    23        -q, --quiet=false    Only show numeric IDs
    24  
    25  The default `docker images` will show all top level
    26  images, their repository and tags, and their virtual size.
    27  
    28  Docker images have intermediate layers that increase reusability,
    29  decrease disk usage, and speed up `docker build` by
    30  allowing each step to be cached. These intermediate layers are not shown
    31  by default.
    32  
    33  The `VIRTUAL SIZE` is the cumulative space taken up by the image and all
    34  its parent images. This is also the disk space used by the contents of the
    35  Tar file created when you `docker save` an image.
    36  
    37  An image will be listed more than once if it has multiple repository names
    38  or tags. This single image (identifiable by its matching `IMAGE ID`)
    39  uses up the `VIRTUAL SIZE` listed only once.
    40  
    41  ### Listing the most recently created images
    42  
    43      $ docker images
    44      REPOSITORY                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    45      <none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB
    46      committ                   latest              b6fa739cedf5        19 hours ago        1.089 GB
    47      <none>                    <none>              78a85c484f71        19 hours ago        1.089 GB
    48      docker                    latest              30557a29d5ab        20 hours ago        1.089 GB
    49      <none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB
    50      postgres                  9                   746b819f315e        4 days ago          213.4 MB
    51      postgres                  9.3                 746b819f315e        4 days ago          213.4 MB
    52      postgres                  9.3.5               746b819f315e        4 days ago          213.4 MB
    53      postgres                  latest              746b819f315e        4 days ago          213.4 MB
    54  
    55  ### Listing images by name and tag
    56  
    57  The `docker images` command takes an optional `[REPOSITORY[:TAG]]` argument
    58  that restricts the list to images that match the argument. If you specify
    59  `REPOSITORY`but no `TAG`, the `docker images` command lists all images in the
    60  given repository.
    61  
    62  For example, to list all images in the "java" repository, run this command :
    63  
    64      $ docker images java
    65      REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    66      java                8                   308e519aac60        6 days ago          824.5 MB
    67      java                7                   493d82594c15        3 months ago        656.3 MB
    68      java                latest              2711b1d6f3aa        5 months ago        603.9 MB
    69  
    70  The `[REPOSITORY[:TAG]]` value must be an "exact match". This means that, for example,
    71  `docker images jav` does not match the image `java`.
    72  
    73  If both `REPOSITORY` and `TAG` are provided, only images matching that
    74  repository and tag are listed.  To find all local images in the "java"
    75  repository with tag "8" you can use:
    76  
    77      $ docker images java:8
    78      REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    79      java                8                   308e519aac60        6 days ago          824.5 MB
    80  
    81  If nothing matches `REPOSITORY[:TAG]`, the list is empty.
    82  
    83      $ docker images java:0
    84      REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    85  
    86  ## Listing the full length image IDs
    87  
    88      $ docker images --no-trunc
    89      REPOSITORY                    TAG                 IMAGE ID                                                           CREATED             VIRTUAL SIZE
    90      <none>                        <none>              77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182   19 hours ago        1.089 GB
    91      committest                    latest              b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f   19 hours ago        1.089 GB
    92      <none>                        <none>              78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921   19 hours ago        1.089 GB
    93      docker                        latest              30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4   20 hours ago        1.089 GB
    94      <none>                        <none>              0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5   20 hours ago        1.089 GB
    95      <none>                        <none>              18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b   22 hours ago        1.082 GB
    96      <none>                        <none>              f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a   23 hours ago        1.089 GB
    97      tryout                        latest              2629d1fa0b81b222fca63371ca16cbf6a0772d07759ff80e8d1369b926940074   23 hours ago        131.5 MB
    98      <none>                        <none>              5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df   24 hours ago        1.089 GB
    99  
   100  ## Listing image digests
   101  
   102  Images that use the v2 or later format have a content-addressable identifier
   103  called a `digest`. As long as the input used to generate the image is
   104  unchanged, the digest value is predictable. To list image digest values, use
   105  the `--digests` flag:
   106  
   107      $ docker images --digests
   108      REPOSITORY                         TAG                 DIGEST                                                                    IMAGE ID            CREATED             VIRTUAL SIZE
   109      localhost:5000/test/busybox        <none>              sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536        9 weeks ago         2.43 MB
   110  
   111  When pushing or pulling to a 2.0 registry, the `push` or `pull` command
   112  output includes the image digest. You can `pull` using a digest value. You can
   113  also reference by digest in `create`, `run`, and `rmi` commands, as well as the
   114  `FROM` image reference in a Dockerfile.
   115  
   116  ## Filtering
   117  
   118  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
   119  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
   120  
   121  The currently supported filters are:
   122  
   123  * dangling (boolean - true or false)
   124  * label (`label=<key>` or `label=<key>=<value>`)
   125  
   126  ##### Untagged images (dangling)
   127  
   128      $ docker images --filter "dangling=true"
   129  
   130      REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
   131      <none>              <none>              8abc22fbb042        4 weeks ago         0 B
   132      <none>              <none>              48e5f45168b9        4 weeks ago         2.489 MB
   133      <none>              <none>              bf747efa0e2f        4 weeks ago         0 B
   134      <none>              <none>              980fe10e5736        12 weeks ago        101.4 MB
   135      <none>              <none>              dea752e4e117        12 weeks ago        101.4 MB
   136      <none>              <none>              511136ea3c5a        8 months ago        0 B
   137  
   138  This will display untagged images, that are the leaves of the images tree (not
   139  intermediary layers). These images occur when a new build of an image takes the
   140  `repo:tag` away from the image ID, leaving it untagged. A warning will be issued
   141  if trying to remove an image when a container is presently using it.
   142  By having this flag it allows for batch cleanup.
   143  
   144  Ready for use by `docker rmi ...`, like:
   145  
   146      $ docker rmi $(docker images -f "dangling=true" -q)
   147  
   148      8abc22fbb042
   149      48e5f45168b9
   150      bf747efa0e2f
   151      980fe10e5736
   152      dea752e4e117
   153      511136ea3c5a
   154  
   155  NOTE: Docker will warn you if any containers exist that are using these untagged images.
   156  
   157  
   158  ##### Labeled images
   159  
   160  The `label` filter matches images based on the presence of a `label` alone or a `label` and a
   161  value.
   162  
   163  The following filter matches images with the `com.example.version` label regardless of its value.
   164  
   165      $ docker images --filter "label=com.example.version"
   166  
   167      REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
   168      match-me-1          latest              eeae25ada2aa        About a minute ago   188.3 MB
   169      match-me-2          latest              eeae25ada2aa        About a minute ago   188.3 MB
   170  
   171  The following filter matches images with the `com.example.version` label with the `1.0` value.
   172  
   173      $ docker images --filter "label=com.example.version=1.0"
   174      REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
   175      match-me            latest              eeae25ada2aa        About a minute ago   188.3 MB
   176  
   177  In this example, with the `0.1` value, it returns an empty set because no matches were found.
   178  
   179      $ docker images --filter "label=com.example.version=0.1"
   180      REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
   181