Docker Introduction & Architecture

Docker Introduction & Architecture

Docker has revolutionised the way software is developed, shipped, and deployed. It simplifies the process of creating, running, and managing applications by using containerization. In this blog, we'll explore what Docker is, its architecture, and how it can be used in real-world scenarios to solve everyday problems in software development and deployment.

Introduction:

Lets consider an example, we are developed an application which is running on Dev environment but not in Prod servers. So here one of the major problem is Dependencies.

For example, dev team developed a Java application and their systems has all required modules and dependencies which are used to run the application. But Those dependencies are not installed on production servers. In this case we cant able to run the applications on Prod servers.

To avoid these kind of issues, we started implementing containerization. Containerization is a process of packing the application along with its dependencies.

To implement containerization, there are lot of tools like Docker, Podman and LXC/LXD. Out of these Docker is the best tool to create containers.

Docker:

Docker is an open-source platform that allows developers to build, package, and run applications in containers. Containers are lightweight, standalone, and executable units that include everything needed to run a piece of software: code, runtime, libraries, and dependencies.

Why Use Docker?

  • Consistency: Docker ensures that our application runs the same way everywhere (Dev, Test and Prod)

  • Efficiency: Containers use fewer resources than traditional virtual machines, as they share the host operating system's kernel.

  • Speed: Containers start almost instantly, making development and deployment faster.

  • Scalability: Docker makes it easy to scale applications horizontally by spinning up more container instances.

Keywords in Docker:

Containers:

  • A Docker container is a lightweight, standalone, and executable software package that encapsulates an application and all its dependencies, including the operating system, libraries, and runtime environment.

  • Containers created from a Docker image and can be run on any machine that has Docker installed, providing a consistent and isolated environment for the application to run.

Images:

  • A Docker image is a read-only template that contains a set of instructions for creating a container that can run on the Docker platform.

  • It provides a convenient way to package up applications and all the dependencies.

  • We can store these images on registry either publicly or privately.

Registry:

  • A Docker registry is a repository for storing and sharing the docker images. Docker is configured to pull the images from Docker Hub by default, but organisations often use private registries for their projects like ECR, ACR, GCT etc…

How it works:

First we need to pull the base image from registry and make some modification using Dockefile. Once we build the Dockerfile, it will create docker image and we can run the image to create a container.

NOTE: To create a container, we need image.

Docker Architecture:

What is Docker? - IT Glossary | eG Innovations

Docker architecture majorly contains this 3 components

  1. Client

  2. Host

  3. Registry

  4. Docker Client: The Docker client is used by users which interact with Docker, when we use such commands to create a container, start the container or delete the container, the client sends these commands to Docker Daemon to perform that particular action.

  5. Docker Host: It is a system where we installed a docker. Ex: EC2 instance, Azure VM, Personal Lappy etc..

  6. Docker Registry: It is used to store and share the docker images. In registry we can store our images on public or private.

Conclusion

Docker has become an indispensable tool in modern software development and deployment. By understanding its architecture and leveraging its features, teams can build, ship, and run applications more efficiently and consistently. Whether you're a developer, DevOps engineer, or IT professional, learning Docker is a step toward mastering containerization and revolutionizing how you handle applications.

Happy Dockering!

If you found this blog helpful for your interviews or in learning Docker troubleshooting, please hit a heart for 10 times and drop a comment! Your support motivates me to create more content on DevOps and related topics. ❤️