Forked from bastman/docker-cleanup-resources.md
Last active
February 8, 2018 11:01
-
-
Save lebeker/aaefa088340a7a84d1fc4cfbed513851 to your computer and use it in GitHub Desktop.
Revisions
-
lebeker revised this gist
Feb 8, 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 @@ -32,7 +32,7 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, $ docker ps $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## remove --restart=always containers $ docker stop <CONTAINER_ID> & docker update --restart=no <CONTAINER_ID> -
lebeker revised this gist
Feb 8, 2018 . 1 changed file with 2 additions and 2 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 @@ -33,8 +33,8 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## remove --restart=always contaimers $ docker stop <CONTAINER_ID> & docker update --restart=no <CONTAINER_ID> ## Resize disk space for docker vm -
lebeker revised this gist
Feb 8, 2018 . 1 changed file with 1 addition and 2 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 @@ -33,9 +33,8 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## remove --restart=always contaimers $ docker update --restart=no <CONTAINER_ID> $ docker stop <CONTAINER_ID> ## Resize disk space for docker vm -
lebeker revised this gist
Feb 8, 2018 . 1 changed file with 2 additions and 2 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 @@ -33,8 +33,8 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## remove --restart=always contaimers $ docker stop <CONTAINER_ID> $ docker update --restart=no <CONTAINER_ID> $ systemctl restart docker -
lebeker revised this gist
Feb 8, 2018 . 1 changed file with 2 additions and 2 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 @@ -33,8 +33,8 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## remove --restart=always contaimers $ docker stop $(docker ps -a -q) $ docker update --restart=no $(docker ps -a -q) $ systemctl restart docker -
lebeker revised this gist
Feb 8, 2018 . 1 changed file with 6 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 @@ -32,7 +32,12 @@ Once in a while, you may need to cleanup resources (containers, volumes, images, $ docker ps $ docker ps -a $ docker rm $(docker ps -qa --no-trunc --filter "status=exited") ## remove --restart=always contaimers $ docker stop $(docker ps -a -q) & $ docker update --restart=no $(docker ps -a -q) & $ systemctl restart docker ## Resize disk space for docker vm $ docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default -
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