Skip to main content

Command Palette

Search for a command to run...

Cloud Native Rebuild – Week 0: Restarting Docker from the Basics

Published
3 min read
Cloud Native Rebuild – Week 0: Restarting Docker from the Basics
A
I’m a curious learner and aspiring software developer who enjoys building real-world systems, exploring new technologies, and learning in public. I write about coding, personal growth, and turning ideas into practical systems—while simplifying complex concepts for others.

This is Week 0 of my Cloud Native Rebuild series.

Before jumping into Kubernetes for LFX open source contributions, I decided to restart Docker from scratch. I already knew the basics — but this time, I want depth, not just familiarity.

For this reset, I followed:

This week was purely theory + basic hands-on.


🐳 What is Docker?

Docker is a containerization platform that allows developers to package applications along with all dependencies into a single, portable unit called a container.

Instead of installing:

  • Node

  • Python

  • System libraries

  • Specific versions

Docker packages everything together.

So if it works on my system, it works everywhere.


⚙️ How Docker Works (Conceptually)

Docker uses OS-level virtualization.

Here’s the flow:

  1. You define instructions in a Dockerfile.

  2. Docker builds an Image.

  3. The image is used to create a Container.

  4. The container runs your application in isolation.

Important concept:
Containers share the host OS kernel, which makes them lightweight compared to virtual machines.


🚨 What Problem Docker Solves

Before Docker:

  • Environment mismatch between dev and production.

  • “Works on my machine” problems.

  • Manual dependency setup.

  • Difficult collaboration across teams.

Docker solves:

  • Environment consistency

  • Reproducible builds

  • Faster onboarding

  • Predictable deployments

  • Simplified CI/CD workflows

Docker standardizes how applications are built and deployed.


💻 Development & Deployment

Without Docker

  • Install dependencies manually.

  • Different Node/Python versions cause issues.

  • Setup instructions are long and error-prone.

  • Deployment often behaves differently than development.

With Docker

  • Application + dependencies bundled together.

  • Same environment everywhere.

  • One command to run.

  • Easy to deploy across machines or servers.

This is why Docker became foundational for cloud-native systems.


🖥️ Virtual Machine vs Docker

Understanding this difference was important for me.

Virtual MachineDocker Container
Has full guest OSShares host OS kernel
Heavy (GB size)Lightweight (MB size)
Slower startupStarts in seconds
Uses hypervisorUses container runtime
More resource usageEfficient

VMs virtualize hardware.
Docker virtualizes the operating system.

This is why containers are faster and lighter.


📦 Docker Image vs Docker Container

This distinction is fundamental.

Docker Image

  • Blueprint or template

  • Read-only

  • Built from Dockerfile

  • Used to create containers

Docker Container

  • Running instance of an image

  • Executable

  • Has state during runtime

  • Can be started, stopped, removed

Image = Blueprint
Container = Running instance


🔌 Container Port vs Host Port (Port Binding)

When an app runs inside a container, it exposes a container port.

To access it from your local machine, you bind it to a host port.

Example:

docker run -p 8080:3000 my-app
  • 3000 → container port

  • 8080 → host port

Now:
localhost:8080 maps to the container’s port 3000.

This concept is critical for real-world deployments.


🛠️ Basic Docker Commands I Revised

Pull an image:

docker pull nginx

List images:

docker images

Run a container:

docker run nginx

Run with port mapping:

docker run -p 8080:80 nginx

List running containers:

docker ps

List all containers:

docker ps -a

Stop a container:

docker stop <container_id>

Remove a container:

docker rm <container_id>

🧠 Key Takeaways from Week 0

  • Docker is not just about running containers — it standardizes environments.

  • Containers are lightweight because they share the host kernel.

  • Understanding image vs container is foundational.

  • Port binding is essential for exposing applications.

  • Kubernetes will make more sense only if Docker fundamentals are strong.

Cloud Native Rebuild: From Docker to Kubernetes

Part 1 of 1

This series documents my journey of rebuilding Cloud Native fundamentals—from Docker to Kubernetes and beyond. As I prepare for LFX open source, I share weekly learnings, hands-on experiments, challenges, and key insights from my cloud journey.

More from this blog