Skip to content

Commit

Permalink
Add image description annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Aug 25, 2024
1 parent a92dd78 commit 0393efc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DEFAULT_GOLANG_VERSION="1.21"
DEFAULT_CHISEL_VERSION="v0.10.0"

REPOSITORY=$(jq -r '.repository' ./images/${IMAGE}/metadata.json)
DESCRIPTION=$(curl -s "https://api.github.com/repos/${REPOSITORY}" | jq -r '.description | values')
RELEASE_METADATA=$(curl -s "https://api.github.com/repos/${REPOSITORY}/releases/latest")
SOURCE_DATE_EPOCH=$(date +%s -d $(echo ${RELEASE_METADATA} | jq -r '.created_at'))
RELEASE=$(echo ${RELEASE_METADATA} | jq -r '.tag_name')
Expand All @@ -35,7 +36,8 @@ else
--label "org.opencontainers.image.version=${VERSION}" \
--label "org.opencontainers.image.vendor=${GITHUB_REPOSITORY_OWNER}" \
--label "org.opencontainers.image.title=${IMAGE}" \
--output type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:${VERSION},rewrite-timestamp=true \
--output type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:latest,rewrite-timestamp=true \
--annotation "index:org.opencontainers.image.description=${DESCRIPTION}" \
--output "type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:${VERSION},rewrite-timestamp=true" \
--output "type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:latest,rewrite-timestamp=true" \
- < images/${IMAGE}/Dockerfile
fi

0 comments on commit 0393efc

Please sign in to comment.