Skip to content

Commit

Permalink
Add labels to container images in build_images.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed Jul 13, 2024
1 parent 05f03a3 commit 859611d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion development/build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ set -xeu
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INTEGRATION_TEST_DIR="$SCRIPT_DIR/../integration-tests/"

LABEL_DATE=$(date -u +'%Y-%m-%dT%H:%M:%S.%3NZ')
LABEL_URL="https://github.com/goss-org/goss"
LABEL_REVISION=$(git rev-parse HEAD)

for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do
[[ $docker_file == *.md5 ]] && continue
os=$(cut -d '_' -f2 <<<"$docker_file")
docker build -t "aelsabbahy/goss_${os}:latest" - < "$docker_file"
docker build \
--label "org.opencontainers.image.created=$LABEL_DATE" \
--label "org.opencontainers.image.description=Quick and Easy server testing/validation" \
--label "org.opencontainers.image.licenses=Apache-2.0" \
--label "org.opencontainers.image.revision=$LABEL_REVISION" \
--label "org.opencontainers.image.source=$LABEL_URL" \
--label "org.opencontainers.image.title=goss" \
--label "org.opencontainers.image.url=$LABEL_URL" \
--label "org.opencontainers.image.version=manual" \
-t "aelsabbahy/goss_${os}:latest" - < "$docker_file"
done

0 comments on commit 859611d

Please sign in to comment.