Skip to main content

Command Palette

Search for a command to run...

🐳 Containers - Day 1 : Introduction

What Are Containers and Why Docker Uses Them

Published
4 min read
🐳 Containers - Day 1 : Introduction
A

Cloud & DevOps enthusiast learning in public ☁️⚙️ Documenting my journey through systems, automation, and real-world engineering problems. Focused on fundamentals, practical learning, and continuous growth.

🖥️ Life Before Containers: Physical Servers & VMs

Before containers, most organizations deployed one application per physical server. This approach led to poor resource usage and high costs. To solve this, virtualization was introduced.

Problems with physical servers:

  • Low CPU utilization

  • Wasted memory and storage

  • Expensive infrastructure

Virtualization allows multiple machines to run on a single server using a hypervisor such as VMware, Xen, or Hyper-V.

📷 Physical server vs Virtual Machines

Physical Servers vs. Virtual Machines


📦 Understanding Virtual Machines

A Virtual Machine (VM) behaves like a complete computer.

Key characteristics of VMs:

  • Each VM has its own full operating system

  • Strong isolation between applications

  • High CPU, RAM, and disk usage

  • Large image and snapshot size

While VMs improved hardware usage, they introduced performance and maintenance overhead.

📷VM architecture with hypervisor


🚀 Why Containers Were Needed

Even with VMs, organizations still faced challenges.

Limitations of VMs:

  • Underutilized resources

  • Slow boot times

  • High storage and licensing costs

  • Heavy OS maintenance

The industry needed something:

  • Faster

  • Lighter

  • More efficient

👉 This led to the adoption of containers.


🧱 What is Containerization?

Containerization runs applications in isolated environments while sharing the host operating system kernel.

A container includes:

  • Application code

  • Required libraries

  • Dependencies

  • A small base image (not a full OS)

This design makes containers lightweight, portable, and fast.

📷VM vs Container comparison diagram


🐳 What is Docker?

Docker is a container platform that helps developers build, package, and run applications as containers.

It provides a simple way to:

  • Create container images

  • Run containers consistently across environments

  • Share applications using container registries

In simple terms:

Docker makes containerization easy and accessible.

Docker became popular because it:

  • Simplified application deployment

  • Reduced “works on my machine” issues

  • Integrated well with CI/CD and cloud platforms

📷Docker

Linux Docker Installation


🏗️ How Containers Are Deployed

Container deployment models have evolved over time.

Earlier deployment model:

Server → OS → Docker → Containers

Modern production model:

Server → VM → OS → Docker → Containers

Why VMs are still used in production:

  • Better isolation

  • Cloud platform compatibility

  • Security and compliance needs


⚡ Why Containers Are Lightweight

Containers avoid the overhead of a full operating system.

Reasons containers are lightweight:

  • No full OS inside the container

  • Shared host OS kernel

  • Minimal base images (Alpine, Ubuntu slim)

Size comparison:

  • VM images → GBs

  • Container images → MBs

This makes containers ideal for:

  • Fast startups

  • Easy portability

  • CI/CD pipelines


🪟 Running Linux Containers on Windows

Containers rely on the Linux kernel, so Linux containers cannot run directly on Windows.

Docker solves this by using:

  • WSL2, or

  • A lightweight Linux virtual machine

Flow:

Windows → Linux VM → Docker → Containers

🧩 Docker Architecture (High-Level Overview)

Docker consists of a few core components working together.

Main Docker components:

  • Docker Client – Command-line interface

  • Docker Engine – Builds and runs containers

  • Docker Image – Application blueprint

  • Docker Container – Running instance of an image

  • Doker Registry – Stores images (Docker Hub, ECR)

Basic workflow:

Dockerfile → Image → Registry → Container

📷 Docker Container Architecture


⚠️ Docker Limitation: Single Point of Failure

Docker relies on a central daemon. If it crashes:

  • All running containers stop

  • New containers cannot be started

Modern solutions:

  • Kubernetes for orchestration

  • Podman + Buildah as daemon-less alternatives


🔧 What is Buildah?

Buildah is a tool used to build container images without a daemon.

Why Buildah is useful:

  • No single point of failure

  • Improved security

  • Smaller and cleaner images

  • Kubernetes-friendly

Buildah is often used with:

  • Podman – to run containers

  • CRI-O – Kubernetes container runtime

Docker Simplified: A Beginner's Guide

Part 1 of 10

A beginner-friendly Docker series covering core concepts, architecture, hands-on examples, Dockerfiles, images, containers, and real-world usage — explained in simple terms.

Up next

🐳 Docker – Day 2: Core Concepts + Hands-On

Understanding Docker Architecture with Practical Commands