Skip to content

Commit db068fe

Browse files
authored
Add labels to container images in build_images.sh (#948)
1 parent eb34898 commit db068fe

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

development/build_images.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@ set -xeu
55
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
66
INTEGRATION_TEST_DIR="$SCRIPT_DIR/../integration-tests/"
77

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

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

0 commit comments

Comments
 (0)