Created
April 12, 2016 11:12
-
-
Save stanislavb/6634fc35b3d1655201a93d2dd2c3a366 to your computer and use it in GitHub Desktop.
Revisions
-
stanislavb created this gist
Apr 12, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/bash # Do not run if removal already in progress. pgrep "docker rm" && exit 0 # Remove Dead and Exited containers. docker rm $(docker ps -a | grep "Dead\|Exited" | awk '{print $1}'); true # It will fail to remove images currently in use. docker rmi $(docker images -qf dangling=true); true # Clean up unused docker volumes docker volume rm $(docker volume ls -qf dangling=true); true