From f7a0aaf94287907389930ee2d2c6f104690f1e91 Mon Sep 17 00:00:00 2001 From: dd Date: Thu, 6 Jun 2024 07:27:18 +0200 Subject: fixed vyos-build-container cache and improved cleanup --- packages/vyos-build-container/build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vyos-build-container/build.sh b/packages/vyos-build-container/build.sh index af5ae34..670c06f 100755 --- a/packages/vyos-build-container/build.sh +++ b/packages/vyos-build-container/build.sh @@ -8,10 +8,13 @@ docker rmi --force "vyos/vyos-build:${BRANCH_NAME}" || true docker rmi --force "${CUSTOM_DOCKER_REPO}/vyos/vyos-build:$BRANCH_NAME" || true echo "Building docker build container for branch ${BRANCH_NAME}..." -docker build . -t "vyos/vyos-build:${BRANCH_NAME}" +docker build --no-cache -t "vyos/vyos-build:${BRANCH_NAME}" . echo "Pushing ${BRANCH_NAME} image to registry ${CUSTOM_DOCKER_REPO}..." docker tag "vyos/vyos-build:${BRANCH_NAME}" "${CUSTOM_DOCKER_REPO}/vyos/vyos-build:${BRANCH_NAME}" docker push "${CUSTOM_DOCKER_REPO}/vyos/vyos-build:$BRANCH_NAME" +echo "Cleaning local registry..." +docker exec registry registry garbage-collect /etc/docker/registry/config.yml --delete-untagged=true + echo "Image ${BRANCH_NAME} was successfully built and pushed to registry ${CUSTOM_DOCKER_REPO}." -- cgit v1.2.3