Created
September 16, 2019 02:32
-
-
Save ShinChven/9a974d23da00219c3ea11e673c3480ff to your computer and use it in GitHub Desktop.
Clean docker host
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 characters
#!/bin/bash | |
docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi |
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 characters
#!/bin/bash | |
docker ps -q -f status=exited | xargs --no-run-if-empty docker rm |
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 characters
#!/bin/bash | |
docker rmi $(docker images | grep "<none>" | awk "{print $3}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment