Skip to content

Commit

Permalink
Delete any dangling images after building a new one. (#1155)
Browse files Browse the repository at this point in the history
* delete dangling docker images

* fix groovy syntax

* fix groovy syntax again

* try a different way to delete dangling images
  • Loading branch information
illsilin authored Feb 5, 2024
1 parent 180f16f commit f0dd1da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def buildDocker(install_prefix){
echo "Building image: ${image_name}"
retimage = docker.build("${image_name}", dockerArgs + ' .')
retimage.push()
sh 'docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi'
}
else{
echo "Checking for image: ${image_name}"
Expand Down

0 comments on commit f0dd1da

Please sign in to comment.