From b8c4ae8e0cdbc2b96e6313e1378a9a93c4f82ed6 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 3 Jun 2022 12:23:03 +0200 Subject: [PATCH] Build: Cleanup dangling docker images after build --- build_scripts/docker/docker.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build_scripts/docker/docker.sh b/build_scripts/docker/docker.sh index e0bd31b5d..97764570f 100755 --- a/build_scripts/docker/docker.sh +++ b/build_scripts/docker/docker.sh @@ -57,6 +57,8 @@ build_package() { move_package_to_dist_dir $tgz_name $dist_dir + clean_stale_images "$docker_image_name" + popd } @@ -75,3 +77,10 @@ build_docker_image_tgz() { move_package_to_dist_dir() { mv "$1" "$2/" } + +clean_stale_images() { + echo "Cleaning images" + + sudo docker rmi $1 + sudo docker image prune --force +}