From 1980001799cf2b4988af495b7f7e8a57da8f2381 Mon Sep 17 00:00:00 2001 From: Gavin Xin Date: Fri, 1 Dec 2023 00:51:54 +0800 Subject: [PATCH] Enhance Docker image cleanup in CI test script (#5751) This patch improves Docker image cleanup to ensure that all images which have not been used recently are also deleted (in addition to dangling images). Signed-off-by: Shuyang Xin --- ci/jenkins/test-vmc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/jenkins/test-vmc.sh b/ci/jenkins/test-vmc.sh index 298f3dbfa01..ae0a17e7749 100755 --- a/ci/jenkins/test-vmc.sh +++ b/ci/jenkins/test-vmc.sh @@ -351,9 +351,9 @@ function deliver_antrea { # The cleanup and stats are best-effort. set +e docker images | grep "${JOB_NAME}" | awk '{print $3}' | uniq | xargs -r docker rmi -f > /dev/null - # Clean up dangling images generated in previous builds. Recent ones must be excluded + # Clean up dangling and unused images generated in previous builds. Recent ones must be excluded # because they might be being used in other builds running simultaneously. - docker image prune -f --filter "until=1h" > /dev/null + docker image prune -af --filter "until=1h" > /dev/null docker system df -v set -e