This is how you can autorun boot2docker
on boot, so that you can use docker
as you would on Linux, without ever* knowing that the daemon's not running locally.
- Install VirtualBox &
boot2docker
(obviously) - Create a startup script with Automator
- Put in
/usr/local/bin/boot2docker up && /usr/local/bin/boot2docker shellinit > ~/.boot2docker-shellinit.sh
- Add
echo "export DOCKER_IP=$(boot2docker ip 2>/dev/null)" >> ~/.boot2docker-shellinit.sh
if you want the non-standard but very-convenientDOCKER_IP
env-var as well (thanks for the suggestion @city41!) - Update your
.profile
or equivalent file withsource ~/.boot2docker-shellinit.sh
- Reboot your machine