Skip to content

Instantly share code, notes, and snippets.

@johnantoni
Last active March 30, 2017 08:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save johnantoni/1e8f1b494a69872dd17e to your computer and use it in GitHub Desktop.
Save johnantoni/1e8f1b494a69872dd17e to your computer and use it in GitHub Desktop.
run boot2docker on system startup - Mac OSX - Yosemite
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.docker.boot2docker</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/boot2docker</string>
<string>up</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>

Add to .zshrc or .bashrc so the environment settings are loaded (DOCKER_HOST, etc.)

eval "$(boot2docker shellinit)"

Note you don't need to give the .plist file 'root' ownership, as scripts inside ~/Library/LaunchAgents are under 'user' ownership.

setup

cp com.docker.boot2docker.plist ~/Library/LaunchAgents
launchctl load com.docker.boot2docker.plist

start deliberately

launchctl start com.docker.boot2docker.plist

check running

ps aux | grep boot2docker

uninstall

launchctl load com.docker.boot2docker.plist
@johnantoni
Copy link
Author

Phew! finally works.

@elrac
Copy link

elrac commented Jul 22, 2015

Hey, thanks for the gist. I had to add a path to it to get it to work. See my change here https://gist.github.com/elrac/c1aff96cb4fbe0177b80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment