Docker – Introduction
🐳 Docker – Introduction
Docker is a containerization platform that lets you package an application with everything it needs (code, runtime, libraries, configs) into a single unit called a container.
Containers run the same way everywhere — on a laptop, server, or cloud.
“It works on my machine” stops being a problem.
🧱 Key Docker Concepts
1️⃣ Image
- A read-only blueprint for a container
- Built from a Dockerfile
- Example: nginx:latest, node:18
2️⃣ Container
- A running instance of an image
- Lightweight and fast
- Starts in seconds
3️⃣ Dockerfile
A text file that defines how an image is built.
Example:
dockerfile
Copy code
FROM node:18 WORKDIR /app COPY . . RUN npm install CMD ["node", "app.js"]
⚙️ Docker Architecture
- Docker Client – docker CLI
- Docker Engine (Daemon) – Runs containers
- Docker Registry – Stores images (Docker Hub, ECR)
🌍 Why Docker Is Used
✔ Consistent environments
✔ Faster deployments
✔ Lightweight (shares OS kernel)
✔ Easy CI/CD integration
✔ Microservices-friendly