What is Docker?
Docker is a containerization tool that allows applications to run in isolated environments called containers. These containers share the same operating system (OS) kernel as the host machine, unlike virtual machines, which run their own guest OS. This makes Docker more lightweight and efficient compared to traditional VMs. It can be installed on any OS but the docker engine runs on Linux distribution. It is also known as OS-level virtualization tool.
Who developed Docker and why?
Docker was developed by Solomon Hykes and Se bastien Paul in March 2013. It is an open-source platform designed to provide a standardized environment for creating, deploying, and running applications. Being open-source means Docker's source code is publicly available and can be freely used, modified, and distributed by anyone. This raises a collaborative environment where developers and organizations contribute to its ongoing development.
Why Docker over Virtual Machines?
Before Docker, Virtual Machines (VMs) were the primary solution for isolating and running applications. However, VMs come with certain limitations. Each VM runs a separate OS instance over the host machine's OS, which consumes significant system resources (CPU, RAM, storage). Docker solves this problem by utilizing the host OS's kernel, which makes it more efficient in terms of resource utilization. Docker is also faster because it doesn’t require the overhead of starting an entire OS. Instead, it runs containers directly on the host system, which leads to quicker startup times and better overall performance.
Advantages and Disadvantages of Docker
Docker is light weight and cost efficient. Unlike VMs, Docker doesn’t require pre-allocation of RAM. It works on images and containers. It allows you to use images as templates to create and run containers, which hold and execute your applications. Docker images are reusable and immutable whereas Docker containers are mutable. Docker ensures the same environment across different machines, reducing the "it works on my machine" problem. Docker containers are fast to start and stop, which accelerates development cycles.
Docker has few limitations too. It is difficult to manage large number of containers. It doesn’t provide cross-platform compatibility for applications which means if an application is designed to run in a docker container on Linux, can’t run on Windows and vice-versa. Moreover, if development and testing are using same OS, Docker is suitable for them but if they are using different OS, Docker is not suitable for them and in that case, they need to move on with VMs. It is not suitable for applications with requirement of rich Graphical User Interface.