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:
1 parent
1842c19a03
commit
97ef925243
1 file changed
+2
-2
@@ -122,9 +122,9 @@ case "$1" in
|
|||||||
|
|
||||||
cleanup)
|
cleanup)
|
||||||
# delete all non-running container
|
# 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
|
# 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)
|
plugins)
|
||||||
|
|||||||
Reference in new issue
Block a user