This script is no longer required with Docker for Mac which includes an option to run Docker at startup and doesn't use docker-machine to administer the local Docker engine.
- Docker Machine + Docker
- curl
- A Virtualbox-driven Docker Machine called "default"
docker-machine create --driver virtualbox default(this is the default with Docker toolkit).
$ curl -sL https://gist.githubusercontent.com/andystanton/257fab335b242bc2658b/raw/c62ae413a0a45ec5d832fb04065a085a8fb477da/com.docker.machine.default.plist | \
sed -e "s?{{docker-machine}}?$(which docker-machine)?" \
-e "s?{{user-path}}?$PATH?" \
>~/Library/LaunchAgents/com.docker.machine.default.plist && \
launchctl load ~/Library/LaunchAgents/com.docker.machine.default.plist
In my case, I want to start the docker-machine when booting (not when user logging in), so I put
com.docker.machine.dev.plistinto/Library/LaunchDaemons/, addas running
docker-machineasrootwill throwHost does not exist: "default"beside that, change file's owner to
root:wheelthen everything is fine.