Slightly improve "cleanup".

- Use docker ps to filter containers by status to avoid building
  such a long pipe.
This commit is contained in:
Alessio Treglia
2015-02-10 12:21:42 +00:00
parent 8b7b2107f4
commit 1842c19a03

2
dokku
View File

@@ -122,7 +122,7 @@ case "$1" in
cleanup)
# delete all non-running container
docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm &> /dev/null &
docker ps -a -f "status=exited" -q | xargs docker rm &> /dev/null &
# delete unused images
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi &> /dev/null &
;;