docker-boon

Unless you live under a rock, you’ve heard of Docker, or Docker containers, or at the very least the concept of containerization. But as we know all too well, the technology landscape contains so many features it’s impossible to know even a little about everything out there. I found myself hearing more and more about Docker, and thought, “Gee, I don’t know that I could really explain this to anyone if asked.” And if you’re in the same boat, this blog post is for you.

The Problem

The first question to answer for any technology is “what problem(s) does it solve?” As I see it, Docker tackles these nagging pain points in DevOps:

Dependency matrix – applications have direct dependencies. Each of these dependencies has their own dependencies, and so on.
“Works on my machine” – says your coworker, as you struggle to deploy the latest code from the source repository. This may be the most annoying, non-helpful (yet honest) answer you can get from a coworker. I’ve heard (and said) this quite often. You know the situation: you do whatever it takes to get the code to run locally, and you try to document everything you did (right?), but this problem keeps cropping up again and again.
Application maturity – as the application matures, and you upgrade dependencies, you have to deal with the dependency tree (i.e., the “matrix” of dependencies), and make sure that these dependencies are reflected in every target environment in which you will test.
Integration Challenges – as you migrate the application to different environments, you have to be aware of other Line-of-Business applications running on the target host, and resolve those one-at-a-time in each environment as part of every migration.
“Let the hunt begin!” – as you migrate to higher environments, and new issues shake out, you have to ask (often) “What’s different between this environment and the last one where everything worked fine?” and manually match up the environments to resolve the differences.
“Um, this application is ready for the cloud, right?” – asks your manager (and their manager, and so on). The traditional one-environment-at-a-time migrate/test strategy is hard enough when DevOps maintains control of every environment. But when it comes to Platform-as-a-Service (PaaS) – and the environments are now outsourced – we are abstracted from the target environment, and the problems above compound and make it virtually impossible to reliably deploy an application.

What Docker is NOT

If you’re familiar with Server Virtualization (e.g., VMWare), it is tempting to think of Containerization and Server Virtualization as synonymous. And while there is some overlap like application isolation and resource management efficiency improvements, they are not the same.

Server Virtualization through the use of Virtual Machines (VMs) solves problems like:

• Data center energy use optimizations (a.k.a., Greening)
• Reducing vendor lockin
• Faster server provisioning
• Increased uptime

Server virtualization depends on a component known as the hypervisor, which abstracts the Virtual Machine (VM) from the underlying hardware. This hardware abstraction requires the hypervisor to be a fairly substantial piece of software indeed!
Containers like Docker on the other hand, abstract applications from the OS, and in the case of Docker this is achieved through the Docker Container Engine. Applications can run in isolation on the same OS instance, resulting in a smaller footprint. In short, server virtualization and containerization are similar, but have different design goals and achieve different results in the data center.


large_h-dark

The Solution

Like shipping containers revolutionized the overseas import/export industry by making the shipping payload opaque and standardized, Docker containers allow the kind of application isolation developers seek without the overhead of the hypervisor.

Dependency Matrix – your application has dependencies, and this is outside of the scope of Docker. As developers, it’s our job to make sure our software has the right dependencies in place to run correctly. But once I have my dependencies resolved (through your Maven build, for example), Docker will ensure they are consistent from one environment to the next through the Docker image.
“Works on my machine” – the changes necessary to get the source to run in your environment are captured in the docker image. So when your colleague needs to run the code, they download the image, along with the code (and dependencies) and it just runs.
Application Maturity – as the application matures, its dependencies will naturally change. As with the dependency matrix, Docker can’t help me decide this, but once I have it working, I modify the image, and now it just works in every environment to which I deploy the application.
Integration Challenges – again, the design of Docker saves the day. Just as my Docker image ensures consistency among various environments, it guarantees a level of isolation from other applications running on the target host (without the overhead of the Server Virtualization Hypervisor). So integration becomes a non-issue.
“Let the hunt begin!” – the Docker Container image is the same for each environment, so there are no manual diffs to perform.
“Um, this application is ready for the cloud, right?” – Platform-as-a-Service (PaaS) providers like IBM Bluemix ensure that Docker Containers will deploy and run consistently from one environment to the next. Any cloud provider that runs Docker (e.g., IBM, Amazon WS, and Rackspace, just to name a few) can be configured so that you just push your Docker image to the cloud and your app runs.

The Bottom Line on Docker and Containers

Docker helps achieve faster development turnaround, application isolation, and consistency among deployments, resulting in ease of integration and better DevOps experiences. Docker does not solve every DevOps issue, certainly. But this exciting technology ensures consistency among all of your target environments, making life easier for DevOps personnel.

Check out the resources below for more information about Docker. And thanks for reading!

Want to Know More About Docker and Containers?

Save

Save

1 comment on"What is Docker? A Primer on the Benefits of Containers for Applications"

  1. Monti Chandra September 06, 2018

    I want to get notifications for the developerWorks Blog

Join The Discussion

Your email address will not be published. Required fields are marked *