Skip to content

Instantly share code, notes, and snippets.

@geek
Forked from mikew/00-README.md
Last active September 2, 2015 02:22
Show Gist options
  • Save geek/162d18551c0d21ff5fd6 to your computer and use it in GitHub Desktop.
Save geek/162d18551c0d21ff5fd6 to your computer and use it in GitHub Desktop.
docker-machine create -d vmwarefusion
#!/bin/bash
name="${1:-test}"
dir="${HOME}/.docker/machine/machines/${name}"
vmx="${dir}/${name}.vmx"
vmrun="/Applications/VMware Fusion.app/Contents/Library/vmrun"
# Something about the initial run of docker-machine+vmwarefusion needs sudo
sudo docker-machine create -d vmwarefusion "${name}"
# Needs to shut down cleanly, which will also need sudo
sudo "${vmrun}" stop "${vmx}"
# Change the owner back to current user
sudo chown -R "${USER}" "${dir}"
echo "You should be able to run 'eval \"\$(docker-machine env ${name})\"'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment