Introduction to Docker and Container-based development 📳

Irushinie Muthunayake
Geek Culture
Published in
7 min readJun 5, 2021

--

A simple overview of Docker and Container-based development.

Generation — 01

📍 Early days we deployed our applications using physical servers.

Example: Assume there is an application, database, and web server. Accordingly in those days, we used three different physical hardware boxes for this purpose.

Problems with those different hardware boxes 🧐

Have to maintain them.(If there were multiple servers, then we need muliple people to maintain it.)

Need more space.

Need seperate network.

Need seperate opertaing system.

High cost.

Waste (As the application server/ web server is not using100% of processing power and the memory of the box, And the database server is not using100% of the space of the box.)

Let’s move to the next generation which was Hypervisor ⇨⇨⇨⇨

Generation — 02 — Hypervisor

📍 In this generation, we use a single high processing hardware box and install the hypervisor on top of that. Then we create multiple virtual machines on top of that hypervisor as shown in the below diagram.

Figure 1

Example:

Figure 2

✹ Assume VM1, VM2, and VM3 are accessing 20%, 10%, & 20% respectively,(Figure 2) So, all of those virtual machines use 50% of processing power, and the remaining 50% can be used for creating other multiple virtual machines. Therefore from this method somehow we were able to solve the wastage issue.

✹ We have installed Operating systems on the top of each virtual machine (Figure 2) and then have installed Apps on those operating systems. So now this is called Virtualized Environment (Generation 2)

Did we solve all our issues? 🧐

NO 😭

Because still there are some drawbacks!

◼️ The cost is high as there are three operating systems (according to figure2). And there is license in cost, need to patch, maintenance and updations. Therefore it needs so much management work.

◼️ We need to create other virtual machines and other operating systems If we need other webservers. So it will take some time for the bootup process in Virtual machines.

This means we didn't solve our issues yet. Isn't it? 🧐

Generation — 03 — Containerized Applications (Containers)

Docker container

If you’re a programmer or developer, you must have heard of Docker. In 2013, dotCloud released their Docker container project to the public as an open-source project named Docker. So docker is an open-source project which was developed internally by a cloud platform called dotCloud. Docker is a container-based platform and can be used by everyone (not just inside dotCloud). Later dotCloud switched its name to Docker, Inc. and this is not owned by Docker, Inc. This was developed by using the Go language as the programming language.

Advantages:

📍 We do not need any separate operating systems or virtual machines when using dockerized environments or containers. So it will save a lot of space and can use the remaining space to create more containers.

📍 We do not need multiple licensing, multiple patching..etc as there are no multiple operating systems.

📍 As we are on top of the host operating system. We can start the application quickly as the operating system is already started.

📍 Security

📍 Multi-cloud platforms

📍Compatibility and Maintainability

Note: 📝 Docker is persistence — whatever you do will remain whenever you shut down or started and it does not get destroyed.

Docker Engine

Docker Engine is not the docker project. And it is a very small part and it is the core orchestration, security, registries, services .. etc and all of these are built on the top/around the docker engine. This is the underlying client-server technology that builds and runs containers by utilizing Docker’s services and Docker’s components.

Docker Registry

This is the place where we store the docker images. Users have the ability to interact with the registry by using pull and push commands.

Some Public Registries are:

Amazon Elastic Container Registry — ECR

Azure Container Registry — ACR

CoreOS Quay

Google Container Registry — GCR

Private Docker Registry

What is a Docker image?

This is a read-only template that has group instructions for making a container that has the ability to run on the Docker platform. It gives a suitable path to package up applications & preconfigured the server environments, which the users can use for their private usage or share publicly with other users of docker.

Docker Hub

This is a hosted registry solution provided by Docker Inc company and through this, the docker users get the ability to access open-source public image repositories. So the users can download whatever docker image they need & customized it and push it back. The Docker hub is considered the largest repository and it has more than 250k repositories and billions of downloads.

If there are multiple hosts and if you need to use the customized images, you can log in and point those hosts to a particular docker registry and can download the customized versions accordingly.

Note: 📝 You can install Docker hubs and Docker registries on your local environment

Orchestration

The reproducibility and portability of a containerized process can be expressed as the chance that we have to scale and move our containerized applications over the cloud and data centers. Containers ensure that those applications work equally everywhere, allowing us to take advantage of these environments quickly and easily.

In addition, as we scale our applications, we need some tools to automatically automate the maintenance and replacement of failed containers and manage the reconfigurations and rollout of updations of the containers over their life cycle. Orchestrators are the tools used to maintain, manage & scale the containerized applications.

Examples: Kubernetes and Docker Swarm

There may be different micro-level services like HTTP runtime engine, authorization process, log in and services ..etc in an application. So you create different containers for those, And the Orchestration is the process where all these modules take together and go for a single goal.

The Orchestration is used for?

It is used to manage and automate the activities such as:

📜 Kubernetes

Kubernetes is one of the open-source container orchestration tools used for the orchestration process. And it enables the automated deployment, management, and scaling of the containerized applications. This gives the ability to persuade those containerized applications to run when & where you need & support to find resources also with other tools which need work This was designed and developed by Google.

Below are some features of Kubernetes:

📍 Storage Orchestration

📍 Batch Execution

📍 Auto-scalable infrastructure

📍 Secret and Configuration Management

📍 Custom Scheduling

📍 Self-Healing

Below is a Kubernetes architecture diagram ➜

The Open Container Initiative — OCI

After launching the product by the Docker Inc company, some other companies started to use the docker concept. But they figured out that, it did not meet all their specifications and their requirements. Also, they have realized some architectural issues. In response to this, they started to implement a similar type of framework called “Rocket”. As there were two different companies taking two different paths and almost for the same initiative, they began to create a mutual agreement “OCI”. The OCI was established in 2015 by Docker and some other leaders in the industry. The OCI has 2 specifications as “Image Specification” (image-spec) and “Runtime Specification”(runtime-spec).

✹ The OCI is the open governance structure for the express purpose of producing open industry standards around container formats & runtimes. (https://opencontainers.org/)

--

--