Skip to content

Instantly share code, notes, and snippets.

@bulkan
Last active July 31, 2017 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bulkan/0d1f3ecb3fc8bbb56b0a8e09978da045 to your computer and use it in GitHub Desktop.
Save bulkan/0d1f3ecb3fc8bbb56b0a8e09978da045 to your computer and use it in GitHub Desktop.
docker fish functions
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
function docker-rmf
docker ps -a --filter "name=$argv[1]" | awk '{print $1 }' | tail -n +2 | xargs -r docker rm -f
end
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