Skip to content

Instantly share code, notes, and snippets.

@jerray
Created June 10, 2016 01:58
Show Gist options
  • Save jerray/0cc5c9ce4548f83855454e8ce9df8098 to your computer and use it in GitHub Desktop.
Save jerray/0cc5c9ce4548f83855454e8ce9df8098 to your computer and use it in GitHub Desktop.
function docker-cli
set vm $argv[1]
if test -s $vm
set vm "default"
end
set host (docker-machine url $vm)
if test -z $host
docker-machine ls
return 1
end
echo "VM: $vm"
echo "Host: $host"
bash -c "DOCKER_HOST=$host DOCKER_CERT_PATH=$HOME/.docker/machine/machines/$vm DOCKER_TLS_VERIFY=1 /usr/local/bin/fish"
end
function load-docker-shell
set vm $argv[1]
if test -s $vm
set vm "default"
end
eval (docker-machine env $vm)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment