Simplify images cleanup too. Reviewed containers cleanup.

- Images cleanup is a common practice taken from
  https://docs.docker.com/reference/commandline/cli/#filtering_1
This commit is contained in:
Alessio Treglia
2015-02-10 12:29:09 +00:00
parent 1842c19a03
commit 97ef925243

4
dokku
View File

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