Skip to main content

Command Palette

Search for a command to run...

Introduction to Docker & It's Architecture

Updated
3 min read

The "Works on My Machine" Problem

One of the most common challenges in software development is environment inconsistency — when an application runs perfectly on a developer's machine but fails when handed off to someone else.

This happens because no two machines are identical. Differences in operating systems, dependency versions, environment variables, file paths, or system configurations can silently break an application that seemed to work just fine locally.

The good news is that the industry has mature solutions for this. Tools like Docker containerize your app along with its entire environment.

Adopting these practices early saves significant debugging time and makes software far more reliable across different machines and teams.

What is Docker?

Docker is an open-source containerization platform that allows developers to package an application along with all its dependencies into a container.

A container includes:

  • Application code

  • Runtime

  • Libraries

  • Dependencies

  • System tools

This ensures the application runs the same way everywhere.

Why developers love it:

  • Eliminates the "works on my machine" problem

  • Easy to share and deploy applications

  • Lightweight compared to full virtual machines

  • Works consistently across development, testing, and production

In short, Docker ensures that if it runs on your machine, it runs everywhere.

Why use Docker?

  • Consistent environments

  • Faster deployments

  • Lightweight compared to virtual machines

  • Easy application distribution

  • Works across different systems

Example:

Instead of configuring environments manually on every machine, Docker lets developers run the application in identical containers.

How Docker 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

Docker follows a client-server architecture. It majorly contains these 3 components: Client, Host, Registry.

  1. Docker Client: The Docker Client is the interface that users use to interact with Docker. It sends commands to the Docker Daemon to perform actions like building images, running containers, or pulling images from a registry.

  2. Docker Host: A Docker Host is the machine (physical server or virtual machine) where Docker is installed and containers are running. It is a system where we installed a docker.

    Ex: EC2 instance, Azure VM, Personal Lappy etc..

  3. 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 a key tool in modern DevOps practices because it enables consistent environments, faster deployments, and efficient application management. Learning how Docker works and understanding its architecture helps developers and DevOps engineers build scalable and portable applications.

In the next part of my Docker learning series, I will explain Docker Images and Containers along with important Docker commands.