Skip to content

Instantly share code, notes, and snippets.

@elrac
Forked from johnantoni/com.docker.boot2docker.plist
Last active August 29, 2015 14:25
Show Gist options
  • Save elrac/c1aff96cb4fbe0177b80 to your computer and use it in GitHub Desktop.
Save elrac/c1aff96cb4fbe0177b80 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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/bin:/usr/bin:/usr/local/bin</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/boot2docker</string>
<string>up</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
</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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment