Skip to main content

Command Palette

Search for a command to run...

Docker Part 1 : Introduction and Architecture

Docker for Beginners - Simple, clear and enjoyable to learn.

Published
4 min read

Think about this for a moment. You try to make your favorite restaurant dish at home — like biryani or pizza. You follow the same recipe and steps, but somehow it never tastes the same.
Why?
Because your kitchen, stove, and ingredients create a different environment.

Same recipe → Different environment → Different results.

This is exactly what happens in software development.
A developer might say, “It works perfectly on my laptop.”
But when the same app runs on another laptop or a server... BOOM — it breaks.
Why?
Because every system is its own kitchen:

  • Different versions

  • Different settings

  • Different dependencies

  • Different configurations

Same code → Different environment → Different results.

Now imagine restaurants start giving you a ready-to-eat box where everything — spices, flavor, ingredients, cooking method — is already fixed inside. No matter where you heat that box, it tastes exactly the same every time. That ready-to-eat box is what Docker gives to software.

Docker packages your app, its dependencies, and entire environment into a small portable container that works the same on any machine, anywhere in the world.

  • In this blog, I’ll explain Docker using:

    • Simple real-world examples

    • Clear analogies

    • Beginner-friendly explanations

... so you'll understand it even if you're hearing the word "Docker" for the first time.

What is Docker?

Docker is a tool that lets you package an application and all its necessary components into a small, portable unit called a container.

Think of it like this:

  • Your application code

  • The necessary software

  • The libraries it depends on

  • The configuration and environment settings it requires

— all bundled together into a single, cohesive package.

This package is the Docker container.

Wherever you deploy this container — on your laptop, a friend's computer, a server, or in the cloud—the application inside will work exactly the same.

Why do we need Docker?

Now that you know what Docker is, let’s quickly see why we actually need it.

  1. Same Results Everywhere
    Without Docker, an application may work on your laptop but fail on another system because every machine has different:

    • Versions

    • Settings

    • Dependencies

With Docker, the whole environment is packed inside the container.

So the app works exactly the same everywhere.

  1. No more “It woks on my machine”
    This is the most common issue in software development.
    Docker removes this problem by giving the app a consistent environment on every system.

  2. Easy to Run and Share
    Sharing your application becomes simple. Anyone can run it with a single command.

     docker run <image-name>
    

    No installations and configuration issues.

  3. Lightweight and Fast
    Containers are small, start quickly and use fewer resources compared to virtual machines. This makes developmet and testing much faster.

  4. Great for DevOps
    Docker is widely used in:

    • Automation

    • Testing

    • CI/CD

    • Cloud deployments

So learning Docker helps with the entire DevOps journey.

Docker Architecture

Architecture of Docker - GeeksforGeeks

The Docker architecture consists of three main parts:

  • Docker Client

  • Docker Host

  • Docker Registry

  1. Docker Client : Place where we run the commands.

    The Docker client is what you interact with. When you type commands like

     docker run
     docker build
     docker pull
    

    you are using the Docker client. It doesn’t do the actual work — it just sends your request to the Docker Host

  2. Docker Host : Place where Images & containers actually run

    The Docker Host is the machine where Docker is installed.
    It contains two important things:

    1. Docker Daemon

      • The background service that:

        • Builds images

        • Runs containers

        • Manages containers

        • Handles all heavy work

    2. Images & Containers

      • Inside the Docker Host, you have:

        • Images → Stored templates

        • Containers → Running instances of images

The Docker Host is basically the place where Docker does all the actual work.

  1. Docker Registry : Place where images are stored and shared
    A Docker Registry is a storage center for images.

    • The most commonly used registry is Docker Hub.

    • You can pull images from a registry.

    • You can push your own images to share with others.

In the diagram above, you can see images stored in the registry, such as:

  • Ubuntu

  • Nginx

  • OpenStack

How Docker works

  1. Pull a base image

    We download a base image from Docker Hub (like Ubuntu, Nginx, etc.).

  2. Modify it (if needed)

    We add our code or make changes on our system.

  3. Build an image

    Docker packages everything using a Dockerfile and creates a new image.

  4. Run a container

    The container is the running version of that image. This container will behave the same anywhere you run it.

That's it for the introduction and architecture of Docker.

In the next part, we'll explore Docker Images and Containers in more detail — what they are, how they work, and how you can use them in real projects.

Stay tuned for Docker Part 2!!!

Docker

Part 3 of 3

In this series, I'll explain Docker in the simplest way possible using clear examples, real-world analogies, and beginner-friendly explanations. If you're new to Docker or DevOps, this series will help you understand the core concepts step-by-step

Start from the beginning

Docker Part 3 - Dockerfile concepts for Absolute Beginners

Step-by-Step Intro to Dockerfile: Understanding Its Function and Image Creation