Added Docker Aliases and Functions

This commit is contained in:
Adphi 2018-05-16 10:43:39 +02:00
parent 8c90baf675
commit c79d9ca8c1

View File

@ -109,3 +109,37 @@ fp() {
done
}
alias wn="watch -n"
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
alias dc="docker-compose"
alias dm="docker-machine"
alias dmq="eval $(docker-machine env -u)"
dme() {
eval $(docker-machine env $1)
}
alias d="docker"
alias cleanContainers="docker container rm \$(docker container ls -a -q) "
alias cleanVolumes="docker volume rm \$(docker volume ls -q) "
swarmCleanVolumes(){
nodes=($(docker-machine ls -q))
for node in "${nodes[@]}"
do
volumes=($(docker-machine ssh ${node} "docker volume ls -q"))
docker-machine ssh ${node} "docker volume rm ${volumes[@]}"
done
}
swarmCleanContainers() {
nodes=($(docker-machine ls -q))
for node in "${nodes[@]}"
do
containers=($(docker-machine ssh ${node} "docker container ls -aq"))
docker-machine ssh ${node} "docker container rm ${containers[@]}"
done
}