Right then. A week or so ago was DockerCon where version 1 of Docker was announced. And personally, I think this is a technology that’s gonna absolutely rock the world!
To set the scene, let’s take a quick look at the world we currently live in.
The VM World
There’s no doubt that we live in a virtual world. But more than just a virtual world, I’d say it’s a virtual machine (VM) world! We all know and love VM’s. They’re a damn sight better than the old physical world we used to live in. It’s just that… well…… they’re still a bit clunky!
In fact, the entire VM world is polluted with too much duplication and waste….
We take a physical server (CPU, RAM and storage etc.), and lash an operating system on top of it. Fair enough, we need to do that. But then, we lash more and more operating systems (Virtual Machines) on top of that. Why!
Well…. Operating Systems obviously provide abstracted resources for applications, and applications tend not to run on bare metal.
Operating Systems also provide memory management systems, scheduling, and constructs like processes and threads… But the Hypervisor is an operating system, and can provide all of that. So why not leverage those functions directly from the hypervisor (operating system) and run apps directly on there?
The VM World Tax
Well…. that brings us to the other major reason we pile the operating systems on. Basically, most operating systems aren’t so good at running multiple apps concurrently. No issue, we’ve got a simple solution to that – for every app, we install a new OS!
Need 30 apps? That’ll be 30 operating systems to go with them! Ouch!!
And that’s where we meet todays major IT issue – VM Sprawl!
Yes, managing 30 VM’s is better than managing 30 physical machines. But it’s still easy to see how the model is fundamentally crap – you get a 100% OS tax every time you deploy a new app!
Every VM has an OS, and most of those OS’s need anti-virus, licensing, patching, booting, managing..… Argghhhh!!
It’s just not great!
And please don’t give me “well if you deploy VM’s on a deduplicating shared storage array you get huge capacity savings”. That’s barely even papering over the cracks!
If we could install applications without operating systems, surely we would. Or put another way…. if we could safely and securely run 30 applications on a single operating system, surely we would!
The guys at Docker (formerly dotCloud) realised this shocking pollution in the VM world. And they looked at Linux and thought, there’s a better way to do this! And they leveraged a bunch of Linux kernel features to build Docker.
Essentially, those kernel features were:
cgroups (Control Groups): allow fine-grained control of resource allocation to groups of processes
Namepsapces: provide workspace isolation for PID, IPC, mounts, networking etc. Taking the PID example, namespaces can create isloated and unique views of the PID namespace
Union filesystems: allow multiple separate filesystems to be layersed on top of each other and create a single unified view
Linux Containers (LXC): Basically combines namespaces and cgroups to create isloated containers in which applications can run
NOTE: Docker has already made the move away from Linux Containers (LXC) as it moves toward being a more OS independent product. As of version 0.9, Docker has started using its own container driver in favour of LXC.
Anyway, in a Docker world, a single underlying OS provides all the HW magic, scheduling, memory management and process goodness. Docker then allows us to install multiple apps on top of that single OS. Each app lives within a Docker container. These containers are lightweight, fast, and SIMPLE! Simpler than VM’s, faster than VM’s, and more lightweight than VM’s! And who wouldn’t want that!
I know this might be new to some, so forgive me for repeating the explanation (it may be useful for some)… Basically, Docker allows us to install multiple apps on top of a single kernel/OS (single OS license, single patching schedule, single mgt…). Each app runs within its own container. And if you know FreeBSD Jails, or Solaris Zones, you’ve a fairly good idea of what Docker containers are. It’s kind of like implementing user-space within containers. Each container is fully isolated and, effectively has it’s own process space, filesystem, memory and network… But it’s not a full VM!
So if you want three apps installing – let’s say Apache, MongoDB, and MySQL – just fire up three containers. One for Apache, one for MongoDB, and one for MySQL. And these containers are simpler, faster and lighter weight than having to spin up and hand-feed three full virtual machines!
It’s Early Days, But…..
Let’s not forget though, it’s early days for Docker. Legacy solutions like VMware ESXi, and other traditional Type 1 hypervisors, have been around for waaaaaay longer! So they’ve naturally got far richer
owners toolsets and features. Things like VMware vMotion are awesome. And Docker’s not there, yet!
Also, Docker is really only a solid solution on Linux at the moment. But they’ve aspirations of being far more than that. It’s one of the major reasons they ditched Linux Containers (LXC)… and you can already get Docker solutions for Mac OSX and Windows – though they’re not anywhere near what Docker is on Linux… yet.
But the race is on. Docker is developing at a rapid pace, and it has some pretty massive players using it and throwing code at it. So watch out VMware, Docker is coming for you, and it doesn’t sleep!
The beauty of Docker is in its simplicity. And as nature proves – the simplest most efficient solutions usually win.
Obviously, for the time being, Docker will sit alongside traditional virtualization solutions like VMware and KVM. But because of it’s lightweight nature and simpler management etc, it will slowly start eating into that legacy virtual machine environment. Savvy people will be looking to move to Docker and Docker-type solutions more and more.
Will Docker, or containers in general, ever take over the world and fully replace traditional virtual machines? Hmmmmm may be not, but I certainly wouldn’t bet against it!
And I know that the VM world has it’s fanbois and intravenous kool-aid takers, but surely nobody expects the VM to be around forever! Nothing lasts forever! So it’s “farewell VM, it’s been nice knowing you. But move on over Grandpa, you’re starting to smell!“.
The big question now is…. who buys Docker? And how does the Open Source nature (Apache 2 license) of the code/project affect a potential acquisition?
Check out my Linux and Storage training courses over at Pluralsight. I seriously think they’re seriously awesome! Seriously! 😀