How itspanand/docker-zero-to-hero works
Project Type and Purpose
• This is an educational, example‐driven repository (“Docker Zero to Hero”) designed to teach Docker concepts through progressively complex hands‐on examples.
File Structure
• Root level:
• README.md, commands.md, networking.md, volumes.md – conceptual docs describing Docker concepts, CLI commands, networks and volumes.
• examples/ – contains three subfolders, each a self‐contained demo:
– first-docker-file/ (Python script + Dockerfile)
– golang-multi-stage-docker-build/ (Go code + multi‐stage Dockerfile + non‐multi‐stage example)
– python-web-app/ (Django app, SQLite DB, settings, templates, Dockerfile, requirements.txt)
README for Additional Insights
• Docker lifecycle: build → run → push
• Isolation primitives: namespaces, cgroups
• Emphasis on layering (each Dockerfile step → image layer)
a. Main Components
– Developer/CI (user invoking docker build, docker run, docker push)
– Docker Client (CLI)
– Docker Daemon (dockerd)
– Host OS Kernel & Filesystem
– Docker Engine & Storage (image layers, container writable layers)
– Docker Registry (Docker Hub or private registry)
– Containers running example workloads:
• Simple Python “app.py” container
• Go multi‐stage build compiled binary container
• Django web app container with SQLite volume
b. Relationships & Interactions
• Developer → Docker Client → Docker Daemon (API calls)
• Daemon ↔ Registry (pull/push images)
• Daemon → Storage Driver (builds image layers)
• Daemon → Host Kernel (namespaces, cgroups)
• Daemon → Containers (run, stop, network attach)
• Containers → Host Resources (network, volumes)
– Show multi‐stage build: build container producing binary → final runtime container
– Show volume mount for Django’s db.sqlite3
c. Architectural Patterns & Principles
– Client‐Server (CLI ↔ daemon)
– Layered immutable images + writable container layer
– Separation of build vs runtime (multi‐stage Dockerfile)
– Isolation via namespaces & cgroups
d. Key Technologies & Frameworks
– Docker (Engine, CLI, Registry)
– Python 3 and pip for simple app
– Go compiler for multi‐stage build
– Django framework + SQLite database for web app
– Linux kernel features (namespaces, cgroups, union‐fs drivers)
Detailed Capture of Architectural Elements
• Developer workstation or CI runner invoking commands.
• Docker internals: image layering, union‐fs driver, writable container layer.
• Inset callouts for example apps: code → Dockerfile → built image → running container → optional volume mount.