Skip to content

Commit

Permalink
Switch to docker context command
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanScherer committed Apr 13, 2019
1 parent b50e3b9 commit 2e771b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .functions
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ function dmhelper() {
commands=(env inspect ip kill ls regenerate-certs restart rm ssh scp start status stop upgrade url help)
if [ -d /mnt/c ]; then
case "${commands[@]}" in *"$1"*) docker-machine.exe $* ; return ;; esac
eval $(docker-machine.exe env -shell bash $1 | sed 's/C://' | sed 's/\\/\//g')
docker context use $1
else
case "${commands[@]}" in *"$1"*) docker-machine $* ; return ;; esac
eval $(docker-machine env $1)
docker context use $1
fi
}

Expand All @@ -162,6 +162,7 @@ function vagrantdm() {
if [ "$1" == "status" ]; then vg status $2; return; fi
if [ "$1" == "rdp" ]; then vg rdp $2; return; fi
if [ "$1" == "regenerate-certs" ]; then vg provision $2; return; fi
if [ "$1" == "ip" ]; then docker context inspect $2 | jq -r '.[0].Endpoints.docker.Host | .[6:] | .[:-5]'; return; fi
dmhelper $*
}

Expand All @@ -176,7 +177,7 @@ function azuredm() {
function dm() {
vagrantmachines=(2016 2016-box 1709 1803 1809 2019 2019-box insider lcow)
case "${vagrantmachines[@]}" in *"${!#}"*) vagrantdm $* ; return ;; esac
azuremachines=(az2019 az2016 az1709)
azuremachines=(az2019 az2016 az1709 az1803)
case "${azuremachines[@]}" in *"${!#}"*) azuredm $* ; return ;; esac
dmhelper $*
}
Expand Down

0 comments on commit 2e771b0

Please sign in to comment.