The new buzz word going around is Docker and it is a big buzzword for a reason. Docker is a powerful tool that can be thought about as a virtual machine. It is not a Virtual Machine (VM) but an “emulator” of different Linux distros. Think of it this way. If you have Fedora we would run the command yum to update, you could create a Docker container to run Debian and update using its container by running apt. Another difference is the size of the container. A VM can be upwards of Gigabytes because it has to have an operating system installed, visualizer, and a virtual hardware. Docker does not do this, it utilizes the hardware already on the system. This is easily accomplished because at the root of it all Linux runs ruffly the same kernel and just as binary’s that change the way it is used.
I am not saying that Docker is a direct replacement to VM or additional hardware what I am saying is it has some amazing advantages.
What is a container
The advantage to Docker is a thing they call containers. A container is a single micro service that runs in its own mini environment. A container utilizes less resources then a VM, although still using more resources than if non containerized. Additionally a container takes up MB of space rather then GB of space. A container can be added and removed in seconds rather then minuets and days like what is needed for a VM. Containers are networked together and can be secured/Isolated from each other or freely pass data.
What do you put in a Container
Containers contain what are call Micro Services a container can contain one service or multiple services all containerized into one micro service. Containers contain all the needed resources that an application would need to run. Have you ever passed you application off to a QA client and it constantly crashes or gets errors you have never seen? Containers solve that problem by allowing you to package all of your dependences in to one neat package and never again will you hear but it works on my machine.
When to use Docker
The best scenario I can think of is when you have a dynamic environment where things are constantly changing. In an ideal world all of a clients systems have all the required software and hardware needed to run you application perfectly. Unfortunately we do not live in an ideal world and if something can go wrong it will.
Here are some others I can think of:
- Building and selling web pages
- Pay per use hosting
- Easily scalable systems IE expanding email or intranet servers
- Migrating …. anything
- Reducing cost of software licensing thing multiple copies of windows.
When to not use Docker
Docker is not good for systems that require large scale applications. Setup time of new applications can take some time. Also for systems that do not need to be dynamic. Docker is slower when it comes to tasks that a dedicated server or VM can do. A dedicated server will be much be much faster at responding to a sudden spike in usage than a container that has a some predefined resources.
Personally I feel Docker has amazing advantages and has its place in the world. It is not perfect but is more agile and allows for ease of scalability.