Forked from bastman/docker-cleanup-resources.md
Last active
September 13, 2018 16:56
-
-
Save dbellotti/0ee403b365515847a62774a21310abe6 to your computer and use it in GitHub Desktop.
Revisions
-
dbellotti revised this gist
Sep 13, 2018 . 1 changed file with 1 addition and 1 deletion.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 @@ -6,8 +6,8 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, // macOS - pathing might be different on your machine # look for the results using a lot of space (lets say it is `com.docker.driver.amd64-linux) $ ls -la ~/Library/Containers/com.docker.docker/Data/ # nuke it $ rm ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 -
dbellotti revised this gist
Sep 13, 2018 . 1 changed file with 5 additions and 1 deletion.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 @@ -2,10 +2,14 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ... ## 🐳 find and remove naughty containers // macOS - pathing might be different on your machine $ ls -la ~/Library/Containers/com.docker.docker/Data/ # look for the results using a lot of space (lets say it is `com.docker.driver.amd64-linux) # nuke it $ rm ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 ## delete volumes -
dbellotti revised this gist
Sep 13, 2018 . 1 changed file with 1 addition and 1 deletion.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 @@ -2,7 +2,7 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ... ## 🐳 just remove all container data // macOS - pathing might be different on your machine -
dbellotti revised this gist
Sep 13, 2018 . 1 changed file with 1 addition and 1 deletion.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 @@ -2,7 +2,7 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ... ## 🐳just remove all container data // macOS - pathing might be different on your machine -
dbellotti revised this gist
Sep 13, 2018 . 1 changed file with 1 addition and 0 deletions.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 @@ -5,6 +5,7 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, ## remove all container data // macOS - pathing might be different on your machine $ rm ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 ## delete volumes -
dbellotti revised this gist
Sep 13, 2018 . 1 changed file with 5 additions and 0 deletions.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 @@ -1,6 +1,11 @@ # Docker - How to cleanup (unused) resources Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ... ## remove all container data // macOS - pathing might be different on your machine $ rm ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 ## delete volumes -
bastman created this gist
Mar 31, 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,39 @@ # Docker - How to cleanup (unused) resources Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ... ## delete volumes // see: https://github.com/chadoe/docker-cleanup-volumes $ docker volume rm $(docker volume ls -qf dangling=true) $ docker volume ls -qf dangling=true | xargs -r docker volume rm ## delete networks $ docker network ls $ docker network ls | grep "bridge" $ docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }') ## remove docker images // see: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images $ docker images $ docker rmi $(docker images --filter "dangling=true" -q --no-trunc) $ docker images | grep "none" $ docker rmi $(docker images | grep "none" | awk '/ / { print $3 }') ## remove docker containers // see: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images $ docker ps $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## Resize disk space for docker vm $ docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default