Skip to content

Instantly share code, notes, and snippets.

@awmichel
Last active February 1, 2023 19:20
Show Gist options
  • Star 37 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save awmichel/baf4337463b326b6d253 to your computer and use it in GitHub Desktop.
Save awmichel/baf4337463b326b6d253 to your computer and use it in GitHub Desktop.
Docker Machine OSX Autostart

Docker Machine OSX Autostart

This is a simple launchd config that will start your default docker-machine on startup. You can customize the machine that is started by updating lines 11 and 16 with the correct machine name.

Install

  1. Copy the file com.docker.machine.default.plist below to ~/Library/LaunchAgents/com.docker.machine.default.plist.
  2. Run the following in a terminal: launchctl load ~/Library/LaunchAgents/com.docker.machine.default.plist
  3. Profit!
<?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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
</dict>
<key>Label</key>
<string>com.docker.machine.default</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/docker-machine</string>
<string>start</string>
<string>default</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
@zackexplosion
Copy link

Can you start container with this too?

@jgillman
Copy link

Worked like a charm! Thanks, @awmichel.

@kameshsampath
Copy link

thanks for posting this @awmichel

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