Created
August 15, 2018 14:33
-
-
Save richardsonlima/92e0be3c62952d61f4535aedea06b139 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node("${params.BUILD_AGENT}") { | |
stage('Dangling Containers') { | |
sh 'docker ps -q -f status=exited | xargs --no-run-if-empty docker rm' | |
} | |
stage('Dangling Images') { | |
sh 'docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi' | |
} | |
stage('Dangling Volumes') { | |
sh 'docker volume ls -qf dangling=true | xargs -r docker volume rm' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment