It seems that a lot of people are talking about Docker at the moment. Interestingly though, it seems that relatively few people understand what Docker actually is and when it should be used. As I’ve been working with it recently, I thought I’d share a few of my incites to help lift the veil and explain what is Docker.
Stripping out the hyperbole: Docker is a technology which allows applications to be run in a controlled environment on a wide variety of platforms. If you are thinking: “that sounds like virtualization” then my answer is both yes and no! Docker can indeed achieve many of the things which virtualization is used for but has both advantages and disadvantages.
Docker allows an application and all of it’s dependencies to be packaged in such a way that it can be deployed into on any platform supporting Docker. These packages can be shared with other users and run as containers within the Docker environment. Docker runs on Linux, Windows and Mac so that’s a fairly large set of machines. You should be aware that the Windows and Mac implementations rely on a tool called Boot2Docker which is built on top of the Virtual Box virtualization application. I’ve not actually benchmarked it but I assume the virtualization layer will slow Docker to some extent.
The Docker environment is light and efficient. Unlike virtualization, it does not attempt emulate hardware or the core operating system. Instead, Docker runs containers on a shared Linux kernel. This results in containers starting much more quickly than virtual machines.
Docker containers are isolated from each other. Although the kernel is shared, the combination of Control Groups and Namespaces provides effective isolation on one container from another.
Docker is not a desk-top virtualization solution, nor does it support Windows applications. Docker containers support Linux server applications only.
There are some security concerns: most notably that you need to take great care with security configuration as Docker allows far more flexibility than that permitted in a conventional virtualization environment. As a minimum, those configuring Docker for a production environment should read and digest the security documentation from the Docker developers.
Having looked at what Docker is, the big question is “What’s if for?”. To which there are many possible answers. Here are a few suggestions;
In summary: Docker is a light-weight, high performance mechanism for virtualizing applications and their environments. It allows you to quickly and easily define a Linux based application environment and deploy it onto multiple platforms.