Skip to content

Commit

Permalink
Use manifest digest for signing (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
agners authored Aug 14, 2024
1 parent 4317da9 commit 73d9da5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,13 @@ function run_build() {
fi
done
done
fi

# Singing image (cosign)
cosign_sign "${repository}/${image}:${version}"
# Singing image (cosign)
if bashio::var.true "${COSIGN}"; then
image_digest=$(docker inspect --format='{{index .RepoDigests 0}}' "${repository}/${image}:${version}")
cosign_sign "${image_digest}"
fi
fi
}

function convert_to_json() {
Expand Down Expand Up @@ -756,10 +759,6 @@ function cosign_sign() {

local success=false

if bashio::var.false "${DOCKER_PUSH}" || bashio::var.false "${COSIGN}"; then
return 0
fi

for j in {1..6}; do
if cosign sign --yes "${image}"; then
success=true
Expand Down

0 comments on commit 73d9da5

Please sign in to comment.