Last active
July 31, 2017 04:17
-
-
Save bulkan/0d1f3ecb3fc8bbb56b0a8e09978da045 to your computer and use it in GitHub Desktop.
docker fish functions
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
function docker-cleanup --description "Drops unused and temporary images" | |
docker rm (docker ps -a -q -f status=exited) | |
docker rmi (docker images -q -f dangling=true) | |
end |
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
function docker-rmf | |
docker ps -a --filter "name=$argv[1]" | awk '{print $1 }' | tail -n +2 | xargs -r docker rm -f | |
end |
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
function docker-rmi | |
docker images -a | tail -n +2 | grep $argv[1] | awk '{ print $3}' | xargs -r docker rmi -f | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment