Add Image Digest doc in userguide/dockerimages
| ... | ... |
@@ -505,6 +505,25 @@ Let's see our new tag using the `docker images` command. |
| 505 | 505 |
ouruser/sinatra devel 5db5f8471261 11 hours ago 446.7 MB |
| 506 | 506 |
ouruser/sinatra v2 5db5f8471261 11 hours ago 446.7 MB |
| 507 | 507 |
|
| 508 |
+## Image Digests |
|
| 509 |
+ |
|
| 510 |
+Images that use the v2 or later format have a content-addressable identifier |
|
| 511 |
+called a `digest`. As long as the input used to generate the image is |
|
| 512 |
+unchanged, the digest value is predictable. To list image digest values, use |
|
| 513 |
+the `--digests` flag: |
|
| 514 |
+ |
|
| 515 |
+ $ docker images --digests | head |
|
| 516 |
+ REPOSITORY TAG DIGEST IMAGE ID CREATED VIRTUAL SIZE |
|
| 517 |
+ ouruser/sinatra latest sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf 5db5f8471261 11 hours ago 446.7 MB |
|
| 518 |
+ |
|
| 519 |
+When pushing or pulling to a 2.0 registry, the `push` or `pull` command |
|
| 520 |
+output includes the image digest. You can `pull` using a digest value. |
|
| 521 |
+ |
|
| 522 |
+ $ docker pull ouruser/sinatra@cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf |
|
| 523 |
+ |
|
| 524 |
+You can also reference by digest in `create`, `run`, and `rmi` commands, as well as the |
|
| 525 |
+`FROM` image reference in a Dockerfile. |
|
| 526 |
+ |
|
| 508 | 527 |
## Push an image to Docker Hub |
| 509 | 528 |
|
| 510 | 529 |
Once you've built or created a new image you can push it to [Docker |