In this note series, we will learn about the basics of Docker, Containers, Images, and registries which includes running applications inside containers, packaging, sharing of applications developed in a container, and storing data in docker volumes. Further, we will see how docker leverages Operating System (OS) security and isolation properties to build a solution that facilitates running an application within a container and comparison with other isolation techniques such as hypervisors. Furthermore, we will see various examples and use cases to work with docker containers.
What is Docker?
Docker is a platform for running applications in lightweight units called containers. A container can be considered the smallest isolated unit that provides isolation from various aspects.
It is an open platform for developers and system administrators to build, ship, and run containerized applications. Moreover, docker is becoming a core competency for developers across the industry. It is one of the most demanding technology ones must know.
In simple words, docker provides a complete ecosystem to create, manage and run containers. It works on Linux, Mac, and Windows operating systems. It has various components, which we will discuss later in this note.
These containers have limited privileges, and these privileges are configured by using the operating system functionalities that have existed for a long time. Moreover, the docker designer leverages those concepts and designs the solution that imposes certain restrictions such as CPU utilization, memory utilization, access control, etc.
Motivation to use Docker Container
In the below section, we have presented a few problems in the traditional way of software development and how the dockerized version of solutions helps to cater to those problems.
Installation and Usage of Open Source Applications
There is various open source software that we usually install before doing the actual development. However, the most tedious task is installing open-source software that requires development packages such as compilers, frameworks, supporting packages, and different compatibilities based on various aspects.
For example, to set up the entire environment for solr, we need to install the appropriate version of JDK. If a proper version is not installed, then it may not work. On the other way round, suppose another application requires a different version of JDK. We usually face this kind of problem during the development environment setup.
Another example, Linux distribution, supports a particular version of development packages by default. Suppose a specific development requires higher or lower versions of development packages, and we can upgrade or downgrade versions as a repercussion; these kinds of changes break other applications.
Deployment of developed solution
If you have deployment and demonstration experiences, you may hear about these excuses that the solution was completely working in the development environment. However, we don’t know why it is not working here. Mainly, we thoroughly test in the development environment, and during the deployment in the new environment, it may be entirely possible that the environment has changed. So, to cater to those kinds of problems, dockerized solutions are preferable.
Cloud-Native Apps
Docker helps us port our existing applications to the cloud, irrespective of whether the entire application is designed as a distributed or monolithic app. However, suppose an application has been designed as a monolithic app. In that case, it can be easily broken into multiple isolated units called containers, and communication links can be established via network sockets. This architecture is mainly considered cloud-native apps where computing units’ addition scales are based on the demands.
The cloud-native computing foundation (CNCF) characterizes as an open-source software stack to deploy applications as microservices, packaging each part into its container and dynamically orchestrating those containers to optimize resource utilization and scalability.
In the below example, the docker host application runs multiple microservices such as Identity microservice, Catalog microservice, Ordering microservice, etc. This architecture gives the flexibility to connect any frontend such as browser-based, mobile app-based, or desktop-based to backend microservices via various API calls. And internally, these microservices do a needful task and communicate to other microservices via network sockets or other mediums.

The entire application is decomposed as microservices, and these microservices are designed and implemented using different programming languages and database technologies. However, every component (microservice) has a Dockerfile to package it, and the whole application is defined in a Docker Compose file.
The two essential artifacts are Dockerfile for each application packaging and Docker Composer file for whole application packaging. In the later section of this note series, we will learn how to compile code, package applications within a docker via dockerfile, and compose the whole application via docker compose file using a single command.
Components of Docker Container
References
CITE THIS AS:
“Introduction to Docker” From NotePub.io – Publish & Share Note! https://notepub.io/notes/container-technology/mastering-docker/introduction-to-docker/