shell - How to delete docker after use in Jenkins -


i want delete remains of docker-operations within jenkins.

but somehow following line not work...

the issue seems parenthesis.

any advice?

if [ docker images -f dangling=true -q|wc -l > 0 ]; docker rmi --force $(docker images -f dangling=true -q);fi 

i store output of docker images command , use it:

images=$(docker images -f dangling=true -q); if [[ ${images} ]]; docker rmi --force ${images}; fi 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -