From 848c54c9106892fb4a5660b608f5ebcc1ce02471 Mon Sep 17 00:00:00 2001 From: Samuel Batista Date: Wed, 21 Jun 2023 23:58:59 -0400 Subject: [PATCH 1/2] Fix command to get docker image digest --- docs/deployment/methods/git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment/methods/git.md b/docs/deployment/methods/git.md index 16b98a72f..a83fe14f8 100644 --- a/docs/deployment/methods/git.md +++ b/docs/deployment/methods/git.md @@ -142,7 +142,7 @@ If the specified image already exists on the Dokku host, it will not be pulled a Triggering a build with the same arguments multiple times will result in Dokku exiting `0` early as there will be no changes detected. If the image tag is reused but the underlying image is different, it is recommended to use the image digest instead of the tag. This can be retrieved via the following command: ```shell -docker inspect --format='{{index .RepoDigests 0}}' $IMAGE_NAME +docker images --no-trunc --quiet $IMAGE_NAME ``` The resulting `git:from-image` call would then be: @@ -232,7 +232,7 @@ FROM dokku/node-js-getting-started:latest When deploying an app via `git:load-image`, it is highly recommended to use a unique image tag when building the image. Not doing so will result in Dokku exiting `0` early as there will be no changes detected. If the image tag is reused but the underlying image is different, it is recommended to use the image digest instead of the tag. This can be retrieved via the following command: ```shell -docker inspect --format='{{index .RepoDigests 0}}' $IMAGE_NAME +docker images --no-trunc --quiet $IMAGE_NAME ``` The resulting `git:load-image` call would then be: From 5c2bb443bd678755f6a42893adec60d0dc279c2d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 9 Sep 2023 22:53:09 -0400 Subject: [PATCH 2/2] docs: clarify when to use a particular method to retrieve the sha256 digest See [this link](https://web.archive.org/web/20230315050507/https://windsock.io/explaining-docker-image-ids/) for an explanation on why the two methods coexist. --- docs/deployment/methods/git.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/deployment/methods/git.md b/docs/deployment/methods/git.md index a83fe14f8..c64e53d87 100644 --- a/docs/deployment/methods/git.md +++ b/docs/deployment/methods/git.md @@ -142,6 +142,11 @@ If the specified image already exists on the Dokku host, it will not be pulled a Triggering a build with the same arguments multiple times will result in Dokku exiting `0` early as there will be no changes detected. If the image tag is reused but the underlying image is different, it is recommended to use the image digest instead of the tag. This can be retrieved via the following command: ```shell +# for images pushed to a remote registry +docker inspect --format='{{index .RepoDigests 0}}' $IMAGE_NAME + +# for images built locally and not pushed to a registry +# use when the previous command output is empty docker images --no-trunc --quiet $IMAGE_NAME ``` @@ -232,6 +237,12 @@ FROM dokku/node-js-getting-started:latest When deploying an app via `git:load-image`, it is highly recommended to use a unique image tag when building the image. Not doing so will result in Dokku exiting `0` early as there will be no changes detected. If the image tag is reused but the underlying image is different, it is recommended to use the image digest instead of the tag. This can be retrieved via the following command: ```shell + +# for images pushed to a remote registry +docker inspect --format='{{index .RepoDigests 0}}' $IMAGE_NAME + +# for images built locally and not pushed to a registry +# use when the previous command output is empty docker images --no-trunc --quiet $IMAGE_NAME ```