Skip to content

MohammeddJaveed/Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐳 Docker Mastery — From Zero to Deployment

A complete, hands-on guide to Docker. Every section is a standalone reference you can return to anytime.


🗺️ Learning Path

# Topic What You'll Learn
1 Docker Fundamentals Architecture, Engine, Lifecycle, Registry
2 Writing Dockerfiles Instructions, best practices, layering
3 Multistage Builds & Distroless Slim images, build optimization
4 Networking Bridge, host, custom networks, DNS
5 Storage — Bind Mounts & Volumes Persistence, data sharing
6 Real-World Deployment on EC2 Django app, EC2 setup, public access

⚡ Most-Used Commands

# Run a container
docker run -d -p 8080:80 --name my-nginx nginx

# See running containers
docker ps

# See all containers (including stopped)
docker ps -a

# View logs
docker logs my-nginx

# Shell into a running container
docker exec -it my-nginx bash

# Build an image
docker build -t myapp:latest .

# Stop and remove a container
docker stop my-nginx
docker rm my-nginx

# List images
docker images

# Remove an image
docker rmi myapp:latest

🧠 Key Mental Models

Images vs Containers — an image is a blueprint (like a class), a container is a running instance (like an object).

Layers — every Dockerfile instruction adds a layer. Layers are cached. Put things that change least (dependencies) before things that change most (your code).

The Daemondockerd runs in the background doing all the work. The docker CLI just sends it instructions.


📄 Also in this repo