Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
hash docker &>/dev/null;
if [ $? -eq 0 ]; then
alias d="docker"
function docker-rm-untagged-imgs() {
[[ $1 == "force" ]] && OPTS="--force" || OPTS="";
docker images | grep "^<none>" | awk '{print "docker rmi '$OPTS' "$3}' | sh
}
function docker-rm-stopped() {
docker rm $(docker ps -a -q)
}
function docker-clean() {
docker-rm-stopped
docker-rm-untagged-imgs
}
function docker-stop-all() {
docker stop $(docker ps -a -q)
}
function docker-kill-all() {
docker kill $(docker ps -q)
}
function docker-rm-all() {
docker rm $(docker ps -a -q)
}
function docker-rm-all-images() {
docker rmi $(docker images -q)
}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.