From c440cc1c8d4d593364f4ef0c7039f1f60b92f3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:49:48 +0200 Subject: [PATCH] Log digest of docker image --- ci/actions/linux/docker-impl/docker-common.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ci/actions/linux/docker-impl/docker-common.sh b/ci/actions/linux/docker-impl/docker-common.sh index 912558b12..c3e6b1c29 100755 --- a/ci/actions/linux/docker-impl/docker-common.sh +++ b/ci/actions/linux/docker-impl/docker-common.sh @@ -134,7 +134,22 @@ docker_login() push_docker_image() { local image_name=$1 + + # Log the image name before pushing + echo "Pushing image: $image_name" + + # Push the image "$scripts"/custom-timeout.sh 30 docker push "$image_name" + + # After pushing, get the digest from the local image manifest + local digest + digest=$(docker image inspect --format='{{index .RepoDigests 0}}' "$image_name") + + if [ -n "$digest" ]; then + echo "::notice::Hash: $digest $image_name" + else + echo "::error::Could not retrieve digest for image $image_name" + fi } deploy_env_images() @@ -154,7 +169,7 @@ deploy_tags() local exclude_pattern=$2 local tags=$(docker images --format '{{.Repository}}:{{.Tag }}' | grep "$repo" | grep -vE "$exclude_pattern") - #Debug list all tags + # Debug list all tags docker images --format '{{.Repository}}:{{.Tag }}' for tag in $tags; do