Skip to content

Commit 2e771b0

Browse files
committed
Switch to docker context command
1 parent b50e3b9 commit 2e771b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.functions

+4-3
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ function dmhelper() {
141141
commands=(env inspect ip kill ls regenerate-certs restart rm ssh scp start status stop upgrade url help)
142142
if [ -d /mnt/c ]; then
143143
case "${commands[@]}" in *"$1"*) docker-machine.exe $* ; return ;; esac
144-
eval $(docker-machine.exe env -shell bash $1 | sed 's/C://' | sed 's/\\/\//g')
144+
docker context use $1
145145
else
146146
case "${commands[@]}" in *"$1"*) docker-machine $* ; return ;; esac
147-
eval $(docker-machine env $1)
147+
docker context use $1
148148
fi
149149
}
150150

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

@@ -176,7 +177,7 @@ function azuredm() {
176177
function dm() {
177178
vagrantmachines=(2016 2016-box 1709 1803 1809 2019 2019-box insider lcow)
178179
case "${vagrantmachines[@]}" in *"${!#}"*) vagrantdm $* ; return ;; esac
179-
azuremachines=(az2019 az2016 az1709)
180+
azuremachines=(az2019 az2016 az1709 az1803)
180181
case "${azuremachines[@]}" in *"${!#}"*) azuredm $* ; return ;; esac
181182
dmhelper $*
182183
}

0 commit comments

Comments
 (0)