ci: add label to docker images

This allows us or the user to perform batch operations on all
images produced by the ci, e.g. to prune all dangling images,
without affecting non-ci images.
This commit is contained in:
stickies-v
2023-05-31 11:34:15 +01:00
parent 73dfa6da08
commit ce1699706e

View File

@ -5,6 +5,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
export CI_IMAGE_LABEL="bitcoin-ci-test"
set -ex set -ex
@ -19,6 +20,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
--file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \ --file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \ --build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
--build-arg "FILE_ENV=${FILE_ENV}" \ --build-arg "FILE_ENV=${FILE_ENV}" \
--label="${CI_IMAGE_LABEL}" \
--tag="${CONTAINER_NAME}" \ --tag="${CONTAINER_NAME}" \
"${BASE_READ_ONLY_DIR}" "${BASE_READ_ONLY_DIR}"
docker volume create "${CONTAINER_NAME}_ccache" || true docker volume create "${CONTAINER_NAME}_ccache" || true