-
-
Save vpotap/3d44292784d7c6797310bc3c6e3f8dc6 to your computer and use it in GitHub Desktop.
Revisions
-
mlebkowski revised this gist
Apr 5, 2016 . 1 changed file with 3 additions and 3 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 @@ -7,6 +7,6 @@ docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm - docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi # remove unused volumes: find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( docker ps -aq | xargs docker inspect | jq -r '.[] | .Mounts | .[] | .Name | select(.)' ) | xargs -r rm -fr -
mlebkowski revised this gist
Jan 24, 2016 . No changes.There are no files selected for viewing
-
mlebkowski created this gist
Jan 24, 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,12 @@ #!/bin/bash # remove exited containers: docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v # remove unused images: docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi # remove unused volumes: find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf \ <(docker ps -aq | xargs docker inspect | jq -r '.[] | .Mounts | .[] | .Name | select(.)') \ | xargs -r rm -fr