misc/docker: refactor aliases

This commit is contained in:
Henrik Lissner 2017-12-25 14:18:30 -05:00
parent efdddf3130
commit c2b0967f07
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1,3 +1,9 @@
alias docker='sudo docker'
alias docker-compose='sudo docker-compose'
alias dkc=docker-compose
alias dkm=docker-machine
dk() {
case $(_os) in
macos) if [[ -z $DOCKER_HOST ]]; then
@ -6,8 +12,5 @@ dk() {
;;
arch) systemctl -q is-active docker || sudo systemctl start docker ;;
esac
sudo docker $@
docker $@
}; compdef dk=docker
alias dkc=docker-compose
alias dkm=docker-machine