Docker is AwesomeJuly 24, 2013
In a previous post, I covered some of the use cases for Vagrant. Vagrant is great at what it does, and I’ll continue to use it for VMs.
In my never-ending search to make life easier, I stumbled across Docker.
Docker is all about containers.
The Docker devs give the analogy that a Docker container is to code as a shipping container is to cargo.
Having a self-contained, standardized method of distributing code/cargo provides more flexibility and automation.
This sounded cool.
There are quite a few Linux distributions out there, but there’s one thing they all have in common, the Linux kernel.
Containers VS Virtual Machines (VM)
Docker provides a higher-level interface to LXC. Containers can be known as operating system level virtualization. VMs attempt to recreate not only the operating system, but hardware, and everything in-between.
A virtual machine (VM) is a software implemented abstraction of the underlying hardware, which is presented to the application layer of the system.
This creates quite a bit of overhead to spin up a VM. As a developer, 9 times out of 10, I don’t care much about virtualizing hardware, but I do care about replicating my application in multiple Linux environments for deployment.
Docker gives you exactly this.
When you create a Docker container, you create an isolated environment that shares only the operating system and the binaries/libraries needed for your application. This gives me the ability to develop in a Docker container on my laptop (Ubuntu), and then push the container to a remote server (CentOS) with no surprises.
Why bother with Vagrant?Vagrant still has its uses. Installing Docker requires a Linux environment. For Windows/Mac devs, Docker recommends using Vagrant to create an Ubuntu VM, then install Docker on your Ubuntu VM. Virtualizationception.
This method is generally good for test driving software before installing on your local machine. Also, anything requiring hardware virtualization/provisioning, Vagrant does a great job.