Docker is so hot right now, and with good reason. Wrapping up applications/services into ‘containers’ that include all their wants, needs (dependencies) and idiosyncracies whilst being lightweight and portable? Yes please!
If there is a drawback to Docker, it’s that it requires a Linux kernel to perform its sorcery (at least, for now). On other platforms, the most common way to mess around with Docker is via a project called Boot2Docker. The OS X installer is comprised of the Boot2Docker ISO (based on Tiny Core Linux, with Docker installed), VirtualBox (to run the image) and some helper tools.
This is all very convenient, but what if you prefer something other than VirtualBox? Well, with Vagrant*, you’re good to go. I’ve posted a Boot2Docker v1.3.0 box on Vagrant Cloud. Here’s how to use it:
- Create a new folder somewhere to keep the Boot2Docker VM
- From the command line, navigate to that folder and
$ vagrant init sebnash/boot2docker
- If you like, take a look at the
Vagrantfileand customise. Then it’s time for a good old
$ vagrant up
- Once the VM has booted, access the Boot2Docker shell by
$ vagrant ssh
Demo video below. Enjoy!