Day 142: Introduction to Containerization and Docker
Beginner's Guide to Containerization and Docker

Today marks an exciting shift in my DevOps journey β stepping into containerization and exploring Docker, one of the most powerful tools in modern infrastructure and DevOps workflows.
After setting up multiple AWS services and automating builds with CodeBuild, itβs time to understand how applications are packaged, shipped, and run consistently across environments β thanks to containers.
π What is Containerization?
Containerization is a lightweight form of virtualization that allows you to package an application and its dependencies into a single unit called a container.
These containers run consistently across:
Developer laptops π§βπ»
Testing servers π§ͺ
Production environments βοΈ
Unlike traditional virtual machines, containers donβt need a full OS β they share the hostβs kernel, making them faster, smaller, and more portable.
βοΈ Virtual Machines vs Containers
| Feature | Virtual Machine | Container |
| OS | Full guest OS per VM | Shares host OS kernel |
| Size | GBs | MBs |
| Startup Time | Minutes | Seconds |
| Isolation | Strong (via hypervisor) | Process-level |
| Performance | Slight overhead | Near-native |
| Portability | Limited | Extremely portable |
π‘ Containers revolutionized DevOps by enabling βbuild once, run anywhere.β
π What is Docker?
Docker is the most popular containerization platform.
It provides tools and commands to:
Build container images ποΈ
Run containers π
Share containers via Docker Hub π
Manage networks and volumes π
With Docker, you can define how your app runs in a Dockerfile, then package and deploy it consistently on any machine.
π¦ Core Docker Components
Docker Engine β The runtime that builds and runs containers.
Docker Images β Immutable blueprints for containers (built from a Dockerfile).
Docker Containers β Running instances of Docker images.
Docker Hub / Registry β Centralized repositories to store and distribute images.
Docker CLI & Daemon β Tools for interacting with and managing containers.
π§± Example: Building a Simple Docker Image
Hereβs a minimal Dockerfile for a Node.js app:
# Use official Node.js image
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm install
# Copy all source code
COPY . .
# Expose port
EXPOSE 3000
# Start the app
CMD ["npm", "start"]
Build and run it:
docker build -t my-node-app .
docker run -p 3000:3000 my-node-app
Boom π₯ β your app is running inside a container, isolated from your system!
π§© Why Docker Matters in DevOps
Docker is a cornerstone of modern DevOps pipelines because it:
Eliminates βworks on my machineβ issues.
Simplifies environment management.
Enables microservices architecture.
Integrates seamlessly with CI/CD tools like Jenkins, GitHub Actions, and CodePipeline.
Forms the base for orchestration tools like Kubernetes and ECS.
π§ Key Takeaways
β
Containers are lightweight, portable, and fast.
β
Docker simplifies container creation, sharing, and deployment.
β
Itβs a foundational tool in CI/CD, cloud, and Kubernetes ecosystems.
β
Mastering Docker = mastering the foundation of cloud-native DevOps.



