Build: Cleanup dangling docker images after build

This commit is contained in:
Ilija Lazoroski 2022-06-03 12:23:03 +02:00
parent cdbe929a87
commit b8c4ae8e0c
1 changed files with 9 additions and 0 deletions

View File

@ -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
}