Prechádzať zdrojové kódy

Add Image Digest doc in userguide/dockerimages

Fixes #12551

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Ankush Agarwal 10 rokov pred
rodič
commit
a4676503d9
1 zmenil súbory, kde vykonal 19 pridanie a 0 odobranie
  1. 19 0
      docs/sources/userguide/dockerimages.md

+ 19 - 0
docs/sources/userguide/dockerimages.md

@@ -505,6 +505,25 @@ Let's see our new tag using the `docker images` command.
     ouruser/sinatra     devel   5db5f8471261  11 hours ago   446.7 MB
     ouruser/sinatra     v2      5db5f8471261  11 hours ago   446.7 MB
 
+## Image Digests
+
+Images that use the v2 or later format have a content-addressable identifier
+called a `digest`. As long as the input used to generate the image is
+unchanged, the digest value is predictable. To list image digest values, use
+the `--digests` flag:
+
+    $ docker images --digests | head
+    REPOSITORY                         TAG                 DIGEST                                                                     IMAGE ID            CREATED             VIRTUAL SIZE
+    ouruser/sinatra                    latest              sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf    5db5f8471261        11 hours ago        446.7 MB
+
+When pushing or pulling to a 2.0 registry, the `push` or `pull` command
+output includes the image digest. You can `pull` using a digest value.
+
+    $ docker pull ouruser/sinatra@cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
+
+You can also reference by digest in `create`, `run`, and `rmi` commands, as well as the
+`FROM` image reference in a Dockerfile.
+
 ## Push an image to Docker Hub
 
 Once you've built or created a new image you can push it to [Docker