The Tao of Docker


How to contain your love of GNU/Linux


Docker, Inc is the exclusive owner of the trademarks DOCKER, Docker Whale Design

Docker is a great technology for sharing tools and shipping apps easily and without much fuss at runtime. For the uninitiated, think of Docker as a way to have mini-computer on top of your regular computer, only this computer does just one task — it can be a web app, database management system, or a network tool. And this mini-computer can easily moved to any other computer or the cloud, where you can start running that app or tool instantly, no extra set up required.

To help put that in perspective, think of all the effort that has gone into building a tool or app — a rich history of development yields everything between the code and the hardware. What Docker does is neatly package that history and allows it to unfold on nearly any piece of hardware. Want to run a GNU/Linux based service with Windows? If you’re running Docker, you can. How about running a Python application on a machine without Python or its libraries? Done with Docker. But it’s hard to talk about Docker without mentioning virtual machines (VMs). How did I discover VMs? GNU/Linux.

I’ve written before about my love of GNU/Linux and how I installed different distros for fun. Working with something a lot gets you up close with both the good and the ugly. The main ugly that reappeared was different distros needing a lot of step up, and most of the time, it was the same steps. To help that, you can get creative with mount points — I used to keep my home directory on a smaller hard drive that I switched between machines. But what if you wanted to take your build in a different direction? Customizing configs would go so far, but what if you messed up? I always thought it would be great to somehow create a snap shot of your system before moving forward with a change — VMs solved that problem.

VMs were a boon to work flows and development. Create a VM, mount a install disc image, and the process is exactly the same as installing a distro on bare metal. A few of my favorite use cases:

  • Don’t like your current OS or want to tweak something without impacting your current machine? Regardless of OS or hardware, install a VM and you’re instantly in another environment filled with familiar tools. It’s dangerous to go alone, so take a snap shot when in doubt, you can always roll back.
  • Prefer a different development environment? Run a VM with a shared folder from your host machine (the one you’re typing on) to your VM and your files will persist, even if your VM goes belly up.
  • Want to try pen testing or capture the flag (CTF) but don’t have spare hardware or want to be charged under the CFAA? Run a VM on your current machine/host machine and use a bridged adapter — it looks just like another machine to the network. And sniffing the network interface is the same result using as bare metal.
  • Want to try a new technology but don’t want to commit your host machine? Install it on a VM and give it a try! More than one company has figured out providing a pre-installed VM is a great way for exposure.

Just a few reasons why VMs are great for development. They’re shareable to boot — It’s no problem to fit a several GB VM on a USB stick. But they’re not easily portable — a single VM can hog a lot of resources (my personal machine and work machine have 16GB RAM for exactly this reason) — that’s a lot of overhead for shipping tools or applications.

Enter Docker.

The TL;DR of Docker: it is a virtualization platform that allows applications to run on any hardware that is running a Docker engine, regardless of host environment. The result is an infrastructure that allows an application to be run anywhere.

The power of Docker is that it makes tools and applications portable, without the need for setting up each machine or the libraries. The application can be developed and seamlessly deployed to different types of hardware in different locations. Getting started is quick and leaves more resources to your host machine compared to VMs.

Moving forward, I believe more services will shift to Docker and containerization. If you’re interested in checking out what I’ve done with Docker, check me out on Dockerhub.