Skip to content

Instantly share code, notes, and snippets.

@neeravkumar
Created January 21, 2014 04:19
Show Gist options
  • Save neeravkumar/8534397 to your computer and use it in GitHub Desktop.
Save neeravkumar/8534397 to your computer and use it in GitHub Desktop.
#!/bin/bash
if ! VBoxManage showvminfo $(VBoxManage list vms|grep dvm|awk '{print $1}'|tr -d '"')|grep -q running
then
VBoxManage startvm $(VBoxManage list vms|grep dvm|awk '{print $1}'|tr -d '"') --type headless
ssh docker@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key "sudo ifconfig eth1 10.1.2.3"
fi
# run VBoxManage modifyvm $(VBoxManage list vms|grep dvm|awk '{print $1}'|tr -d '"') --natpf1 "docker,tcp,127.0.0.1,4243,,4243" once for below
export DOCKER_HOST=tcp://127.0.0.1:4243
/usr/local/bin/docker $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment