Merge pull request #1982 from guardicore/1959-remove-dangling-docker-images

Build: Cleanup dangling docker images after build
This commit is contained in:
VakarisZ 2022-06-03 13:56:41 +03:00 committed by GitHub
commit baa2bd1c34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}