forked from p15670423/monkey
Merge pull request #1982 from guardicore/1959-remove-dangling-docker-images
Build: Cleanup dangling docker images after build
This commit is contained in:
commit
baa2bd1c34
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue