In the journey to DevOps, Let's continue and learn the new tools in DevOps & the Cloud i.e. Docker from basics to advanced.
In the previous blog, we learned how we can host a static website on a cloud platform. If you haven't read it yet go check it out here - Static Website Hosting on Cloud
In this blog, we will learn the fundamentals of Docker from the basics and its functionality.
Nowadays, most software is built using a microservices architecture. The easiest way of building microservices is by using containers.
About Docker
Founded as DotCloud in 2008 by Solomon Hykes in Paris, what we now know as Docker started as a platform as a service (PaaS) before pivoting in 2013 to focus on democratizing the underlying software containers its platform was running on.
Docker is a popular open-source containerization tool used to provide a portable and consistent runtime environment for software applications while consuming fewer resources than a traditional server or virtual machine.
Docker helps developers build lightweight and portable software containers that simplify application development, testing, and deployment.
What is Containerization?
Containerization is a process of packaging your application together with its dependencies into one package (a container).
Such a package can then be run pretty much anywhere, no matter if it’s an on-premises server, a virtual machine in the cloud, or a developer’s laptop. By abstracting the infrastructure, containerization allows you to make your application truly portable and flexible.
Why Docker or Containerization?
Traditionally, to install and run any software on any server, you need to meet several requirements. The software needs to support your operating system, and you probably need to have a few libraries and tools installed to run the software.
Containers work a little like VMs but in a far more specific and granular way. They isolate a single application and its dependencies—all of the external software libraries the app requires to run—both from the underlying operating system and from other containers. All of the containerized apps share a single, common operating system (either Linux or Windows), but they are compartmentalized from one another and the system at large.
Docker enables more efficient use of system resources
Docker enables faster software delivery cycles
Docker enables application portability
Docker shines for microservices architecture
Architecture of Docker
Docker follows Client-Server architecture, which includes three main components that are Docker Client, Docker Host, and Docker Registry.
The Docker client uses commands and REST APIs to communicate with the Docker Daemon (Server).
When a client runs any docker command on the docker client terminal, the client terminal sends these docker commands to the Docker daemon. Docker daemon receives these commands from the docker client in the form of command and REST API's request.
Docker Host is used to provide an environment to execute and run applications. It contains the docker daemon, images, containers, networks, and storage.
Docker Registry manages and stores the Docker images.
There are two types of registries in the Docker -
Pubic Registry - A Public Registry is also called a Docker hub.
Private Registry - It is used to share images within the enterprise.
Objects in Docker
Docker Images are the read-only binary templates used to create Docker Containers. It uses a private container registry to share container images within the enterprise and also uses a public container registry to share container images within the whole world. Metadata is also used by docker images to describe the container's abilities.
Docker Containers are the structural units of Docker, which are used to hold the entire package that is needed to run the application. The advantage of containers is that it requires very less resources.
In other words, we can say that the image is a template, and the container is a copy of that template.
Docker Storage is used to store data on the container.
So in this blog, we understood the fundamentals of Docker & its basic functionality. In the next blog, we will learn the installation process of Docker in Windows & Ubuntu as well as its basic operations.
Explore more on this topic until then stay tuned for my next blog.
Happy Learning 🚀