What is docker? - Overview

What is docker? - Overview

This post will provide you Docker overview and when you need to use it


Docker is an open platform for developing, shipping, and running applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

Docker architecture (Learn OpenShift - O’Reilly)

The Server/Host (Docker Daemon) is a service that runs on your host operating system. The Docker platform runs natively on Linux (on x86-64, ARM, and many other CPU architectures) and on Windows (x86-64). The Daemon is accessible via API & CLI. Inside the Daemon, there will be many containers/images.

Images: Are built from your code. It uses an ISOLATED filesystem so it MUST contain all dependencies, configurations, scripts, and binaries,... For example, you'll need an image containing an OS, Node.js with NPM to run a Node.js application.

Container: This is a sandboxed process on your machine that is ISOLATED from all other processes on the host machine. It is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. It can be run on any OS, on any environment like local machines, or virtual machines, or deployed to the cloud.

The Registry (Docker Hub & other Registries) is a cloud-based service that allows you to link your code, build your images, and store them. We can link our host to Registries to deploy/run those images as containers. This blog, for example, is running in a Docker container which is running on a virtual machine.


An easy-to-read version of Docker (In simple English)

Let’s say you need to build an application, a Web service, API Gateway, or whatever. To make that application available to the public, you need someplace to host it. In the past, you would need to build your own computer and set up a server (Virtual Private System or VPS) or use shared hosting services.
Recently, good hosting companies (Amazon, Google, Microsoft, Oracle,...) adopted a concept called virtualization, meaning that the hardware resources can be broken down even further through software functionality and provide resources more optimally to customers who need them.

In this concept, you only pay for the services you use, instead of setting up the entire server for your own use. This is generally more cost-efficient for both yourself and the hosting company, not to mention it is more optimized for performance.
But even traditional cloud computing cannot avoid one thing — heavy Operating System usage. The operating systems refer in this case are Microsoft Windows, Linux (RHEL, Ubuntu, Fedora, etc...), and MacOS. These OSs are large in size and can easily go over 1 GB, also known as "OS image" you don't want your application always starts with 1GB+ so the concept of  "Container" comes to fix that.
Instead of hosting each operating system per each application, some common resources can be shared, and there is something called "Docker engine" which sits on top of an Operating System as shown below.

As you can see from the figure above, you can visually observe how the app number became much less with the use of a container. In one way, this is a very simple solution, nothing more than introducing another layer between OS and applications to optimize resource usage and reduce the need for redundant operating systems. This level of abstraction is exactly what enterprise companies and individual developers needed.


Reason to use Docker:

  1. Environment Isolation: All dependencies are included and isolated with other resources
  2. Platform-Independent: Not depending on OS
  3. Rapid Development & Deployment: Doing repetitive tasks automatically
  4. Scalability & Flexibility: Can run multiple instances of the same containers simultaneously with its own set of configurations
  5. No More Security Issues: Cannot access data server-wide
  6. Ship Anytime, Anywhere: Any computer/VMs/Cloud service with the same architecture of images can run Docker containers

References: Docker Docs
What is Docker? ”In Simple English”
8 Reason Why Docker Matter for Devs