Wednesday, January 21, 2015

Open Media Vault and Docker, Part 1

For the past couple of weeks, I've been playing around with Docker, which is rapidly gaining popularity as a way to deploy applications across a variety of different environments.  What is it?  Well, as best as I can understand, it basically provides a software interface to operating-system level virtualisation.  What does that mean?  Well, Docker takes a bunch of features available in the Linux kernel, and uses them to allow you to create isolated "containers", which are somewhat akin to virtual machines, but with very minimal overhead.  A lot of people have compared Docker containers to FreeBSD jails -- although, whether it is a relevant comparison depends on who you ask.

But who cares what Docker is?  What can it actually do?  Well, we can take a computer running linux with Docker installed (let's call it the "host") and install an isolated guest container, for the purposes of running particular software.  When the software is no longer required, the container shuts down.  It can be deleted if it is no longer needed, it can remain dormant until required again, or a snapshot of the container can be saved as an image that can be used as a template or starting point for more containers in the future.  The host system itself, remains untouched.  Furthermore, the container doesn't have to be the same version of linux as the host... it doesn't even need to be the same distribution.  For example, you could run Fedora as your host, but use Debian for a container.

What gets people really excited about this, is that it can make it really easy to deploy new applications.  If I write a piece of software for linux, it could end up being deployed to systems running Fedora, Debian, Slackware, Ubuntu, Arch, or whatever.  While the software will be fundamentally compatible with each of these different distributions, variations in architecture of each distribution make the software installation process slightly different each time.

Alternatively, I could write a simple installation process based on the distribution of my choice, say Debian.  The installation steps are put into a Dockerfile, which uses a standardised set of syntax, and the Dockerfile is made available to end users.  An end user can then run the "docker build" command on the Dockerfile, and they'll end up with a docker container using Debian, and running the software... irrespective of their host distribution.  For a lot of users, this is sort of a "big deal".  It among other things, it allows system admins to manage servers using their preferred distribution, even if the applications they run need to be running in a different distro.  It also allows an admin to mix and match different versions of containers without needing to change the host.  Want to run software the needs Debian Jessie, but don't want to upgrade your host from Debian Wheezy?  No worries, Docker can handle it.

That's pretty cool.

But what's even cooler, is that in addition to working on linux, by using boot2docker, Docker can also be installed on Windows and OSX.  Want to run an application designed specifically for linux, but still use your favourite OS?  Install boot2docker and you have a working Docker environment within a few minutes.  Microsoft must be feeling a bit pinched by Docker, because they've actually announced that they'll be including Docker support in the next version of Windows server.

What's that cracking sound?  I think it's the sound of hell freezing over...

No comments:

Post a Comment