Installing Vagrant

Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the “works on my machine” excuse a relic of the past.

Installation via homebrew cask:

$ brew cask install vagrant

If you don't use homebrew cask, you can install Vagrant via the Vagrant website.

If you want to roll your own

Installing linux kernel 3.8 on precise

If using ubuntu 12.04 (precise) you will need to upgrade the kernel, if you are on trusty 14.04, skip this.

Don't know your kernel version? Just type uname -a in the command line and it will return it for you.

To quote the docker docs:

Due to a bug in LXC, Docker works best on the 3.8 kernel. Precise comes with a 3.2 kernel, so we need to upgrade it. The kernel you’ll install when following these steps comes with AUFS built in. We also include the generic headers to enable packages that depend on them, like ZFS and the VirtualBox guest additions. If you didn’t install the headers for your “precise” kernel, then you can skip these headers for the “raring” kernel. But it is safer to include them if you’re not sure.

Build Base Images

A base image is what docker pulls from to start the build. You can find trusted base images in the docker index. Now for this I have already created a slew of dockerfiles that we will create base images from in the apps directory.

If you ssh into the vagrant box with the Vagrantfile provided, the directories are synced and these should be located at /var/presentation/apps in your vagrant box. Included in the directory are extremely minimal Dockerfiles for node, python, ruby, and go.

NOTE: For the purposes of this I have seperate dockerfiles, but in a perfect world you would have images based off languages. Then in other dockerfiles that use that language you can import FROM lang/base. Like the example in my slides. Since the cache works from the top to the bottom you want all the similar things that most dockerfiles have at the top and then the volatile changes at the bottom.