docs: complete project research
This commit is contained in:
408
.planning/research/ARCHITECTURE.md
Normal file
408
.planning/research/ARCHITECTURE.md
Normal file
@@ -0,0 +1,408 @@
|
|||||||
|
# Architecture Patterns
|
||||||
|
|
||||||
|
**Domain:** Docker-based Cloud Lab Environments for Education
|
||||||
|
**Researched:** 2026-03-24
|
||||||
|
**Confidence:** HIGH
|
||||||
|
|
||||||
|
## Recommended Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────────────────────────────────────┐
|
||||||
|
│ Docker Host System │
|
||||||
|
│ ┌────────────────────────────────────────────────────────────────┐ │
|
||||||
|
│ │ Student/Developer Interface │ │
|
||||||
|
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
|
||||||
|
│ │ │ Terminal/SSH │ │ Browser │ │ Git Client │ │ │
|
||||||
|
│ │ │ (docker cli) │ │ (Web Console)│ │ (Versioning) │ │ │
|
||||||
|
│ │ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ │
|
||||||
|
│ └─────────┼─────────────────┼─────────────────┼─────────────────┘ │
|
||||||
|
├────────────┼─────────────────┼─────────────────┼─────────────────────┤
|
||||||
|
│ │ │ │ │
|
||||||
|
│ ┌─────────▼─────────────────▼─────────────────▼─────────────────┐ │
|
||||||
|
│ │ Docker Engine (v24.0+) │ │
|
||||||
|
│ │ Container Orchestration │ │
|
||||||
|
│ └───────────────────────────────────────────────────────────────┘ │
|
||||||
|
│ │ │
|
||||||
|
│ ┌───────────────────────────┼───────────────────────────────────┐ │
|
||||||
|
│ │ │ │ │
|
||||||
|
│ │ ┌────────────────────────▼─────────────────────────────┐ │ │
|
||||||
|
│ │ │ Docker Compose (Project Level) │ │ │
|
||||||
|
│ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │ │ │
|
||||||
|
│ │ │ │ Lab 1 │ │ Lab 2 │ │ Lab 3 │ │ Lab 4 │ │ │ │
|
||||||
|
│ │ │ │ IAM │ │ Network │ │ Compute │ │Storage │ │ │ │
|
||||||
|
│ │ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └───┬────┘ │ │ │
|
||||||
|
│ │ └───────┼─────────────┼─────────────┼─────────────┼──────┘ │ │
|
||||||
|
│ └──────────┼─────────────┼─────────────┼─────────────┼───────────┘ │
|
||||||
|
│ │ │ │ │ │
|
||||||
|
│ ┌──────────▼─────────────▼─────────────▼─────────────▼───────────┐ │
|
||||||
|
│ │ Docker Networks Layer │ │
|
||||||
|
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ │
|
||||||
|
│ │ │ Public Network │ │ Private Net 1 │ │ Private Net 2 │ │ │
|
||||||
|
│ │ │ (bridge) │ │ (isolated) │ │ (isolated) │ │ │
|
||||||
|
│ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │ │
|
||||||
|
│ └───────────────────────────────────────────────────────────────┘ │
|
||||||
|
│ │ │
|
||||||
|
│ ┌───────────────────────────▼───────────────────────────────────┐ │
|
||||||
|
│ │ Storage Layer │ │
|
||||||
|
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │
|
||||||
|
│ │ │ Named Volume │ │ Named Volume │ │ Bind Mounts │ │ │
|
||||||
|
│ │ │ (Block) │ │ (Object) │ │ (Config/Scripts) │ │ │
|
||||||
|
│ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ │
|
||||||
|
│ └───────────────────────────────────────────────────────────────┘ │
|
||||||
|
└─────────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
### Component Boundaries
|
||||||
|
|
||||||
|
| Component | Responsibility | Communicates With |
|
||||||
|
|-----------|---------------|-------------------|
|
||||||
|
| **Docker Engine** | Container lifecycle, image management, network isolation | Docker CLI, Docker Compose |
|
||||||
|
| **Docker Compose** | Multi-container orchestration per lab, service dependencies | Docker Engine, docker-compose.yml files |
|
||||||
|
| **Bridge Networks** | VPC/Subnet simulation, network isolation, DNS resolution | Containers within same network only |
|
||||||
|
| **Named Volumes** | Persistent data storage (DB, Object Storage), data isolation | Containers mounting specific volumes |
|
||||||
|
| **Test Containers** | Network connectivity verification, service health checks | Target services via internal DNS |
|
||||||
|
| **Student Workspace** | Git repo, lab documentation, test scripts | Docker CLI via socket |
|
||||||
|
|
||||||
|
### Data Flow
|
||||||
|
|
||||||
|
**1. Lab Initialization:**
|
||||||
|
```
|
||||||
|
Student → git checkout lab-XX-network
|
||||||
|
↓
|
||||||
|
Student → docker compose up -d
|
||||||
|
↓
|
||||||
|
Docker Compose → Parse compose.yml
|
||||||
|
↓
|
||||||
|
Docker Engine → Create networks (public, private-a, private-b)
|
||||||
|
↓
|
||||||
|
Docker Engine → Create volumes (data-b, logs)
|
||||||
|
↓
|
||||||
|
Docker Engine → Start containers (attach to networks)
|
||||||
|
↓
|
||||||
|
Containers → Internal DNS resolution (service names)
|
||||||
|
```
|
||||||
|
|
||||||
|
**2. Cross-Network Communication (VPC Simulation):**
|
||||||
|
```
|
||||||
|
Container A (Public Net) → curl http://backend:8080
|
||||||
|
↓
|
||||||
|
Docker Internal DNS → Resolve backend to 10.0.1.2
|
||||||
|
↓
|
||||||
|
Network Layer → Check routing table
|
||||||
|
↓
|
||||||
|
[Different networks] → REJECT (no route)
|
||||||
|
↓
|
||||||
|
[Same network] → Allow → Container B receives request
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. Persistent Storage Flow:**
|
||||||
|
```
|
||||||
|
Container (PostgreSQL) → Write to /var/lib/postgresql/data
|
||||||
|
↓
|
||||||
|
Volume Mount (named volume: db-data)
|
||||||
|
↓
|
||||||
|
Docker Volume Driver → Store in /var/lib/docker/volumes/db-data/_data
|
||||||
|
↓
|
||||||
|
Container restart → Data persists
|
||||||
|
↓
|
||||||
|
docker compose down -v → Volume removed
|
||||||
|
```
|
||||||
|
|
||||||
|
## Patterns to Follow
|
||||||
|
|
||||||
|
### Pattern 1: Network Isolation for VPC Simulation
|
||||||
|
|
||||||
|
**What:** Use multiple bridge networks to simulate VPC public/private subnets. Containers in different networks cannot communicate unless explicitly connected.
|
||||||
|
|
||||||
|
**When:** All network labs, security isolation demonstrations, multi-tier applications.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
```yaml
|
||||||
|
# docker-compose.yml
|
||||||
|
networks:
|
||||||
|
public-subnet:
|
||||||
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 10.0.1.0/24
|
||||||
|
private-subnet:
|
||||||
|
driver: bridge
|
||||||
|
internal: true # No internet access
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 10.0.2.0/24
|
||||||
|
|
||||||
|
services:
|
||||||
|
web-server:
|
||||||
|
networks:
|
||||||
|
- public-subnet
|
||||||
|
- private-subnet # Can talk to both
|
||||||
|
database:
|
||||||
|
networks:
|
||||||
|
- private-subnet # Only private
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pattern 2: Resource Limits for Compute Quota
|
||||||
|
|
||||||
|
**What:** Enforce CPU and memory limits at container level to simulate cloud instance sizes (t3.micro, t3.small, etc.).
|
||||||
|
|
||||||
|
**When:** Compute labs, performance testing, resource isolation demos.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
app-tier:
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.5' # 0.5 vCPU = t3.micro equivalent
|
||||||
|
memory: 512M # 512MB RAM
|
||||||
|
reservations:
|
||||||
|
cpus: '0.25'
|
||||||
|
memory: 256M
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pattern 3: Healthcheck for Service Readiness
|
||||||
|
|
||||||
|
**What:** Use built-in HEALTHCHECK directive to ensure services are ready before dependent containers start.
|
||||||
|
|
||||||
|
**When:** Multi-tier applications, database-dependent services, testing labs.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pg_isready", "-U", "admin"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
app:
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pattern 4: Volume Initialization with Seed Data
|
||||||
|
|
||||||
|
**What:** Use init containers or volume pre-population to create databases with initial schema/data.
|
||||||
|
|
||||||
|
**When:** Database labs, storage testing, demonstration environments.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
db-init:
|
||||||
|
image: postgres:15
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/postgresql/data
|
||||||
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: labdb
|
||||||
|
POSTGRES_USER: admin
|
||||||
|
POSTGRES_PASSWORD: secret
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pattern 5: Test Container Pattern
|
||||||
|
|
||||||
|
**What:** Create lightweight "probe" containers to verify network isolation and connectivity.
|
||||||
|
|
||||||
|
**When:** Network labs, security testing, isolation verification.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
```yaml
|
||||||
|
# test-connectivity.yml
|
||||||
|
services:
|
||||||
|
probe-public:
|
||||||
|
image: nicolaka/netshoot
|
||||||
|
networks:
|
||||||
|
- public-subnet
|
||||||
|
command: |
|
||||||
|
sh -c "nc -zv web-server 80 &&
|
||||||
|
nc -zv minio 9000 &&
|
||||||
|
! nc -zv database 5432" # Should fail
|
||||||
|
```
|
||||||
|
|
||||||
|
## Anti-Patterns to Avoid
|
||||||
|
|
||||||
|
### Anti-Pattern 1: Using Default Bridge Network
|
||||||
|
|
||||||
|
**What:** Not defining custom networks, letting containers use the default `bridge` network.
|
||||||
|
|
||||||
|
**Why bad:** Containers communicate without restriction, no DNS resolution by name, poor security simulation.
|
||||||
|
|
||||||
|
**Instead:** Always create named bridge networks with explicit subnets.
|
||||||
|
|
||||||
|
### Anti-Pattern 2: Running Containers as Root
|
||||||
|
|
||||||
|
**What:** Not specifying `user:` directive in Dockerfile or compose file.
|
||||||
|
|
||||||
|
**Why bad:** Security vulnerability, violates cloud best practices (no root in production).
|
||||||
|
|
||||||
|
**Instead:** Use `user: "1000:1000"` or create users in Dockerfile.
|
||||||
|
|
||||||
|
### Anti-Pattern 3: Exposing All Ports to Host
|
||||||
|
|
||||||
|
**What:** Using `ports: ["8080:8080"]` for all services.
|
||||||
|
|
||||||
|
**Why bad:** Port conflicts, security exposure, breaks isolation simulation.
|
||||||
|
|
||||||
|
**Instead:** Only expose public-facing services. Use internal networking for backend.
|
||||||
|
|
||||||
|
### Anti-Pattern 4: Anonymous Volumes for Persistent Data
|
||||||
|
|
||||||
|
**What:** Letting Docker create anonymous volumes without naming.
|
||||||
|
|
||||||
|
**Why bad:** Difficult to manage, can't backup easily, hard to reference.
|
||||||
|
|
||||||
|
**Instead:** Always use named volumes in compose file.
|
||||||
|
|
||||||
|
### Anti-Pattern 5: No Resource Limits
|
||||||
|
|
||||||
|
**What:** Running containers without CPU/memory constraints.
|
||||||
|
|
||||||
|
**Why bad:** No cloud quota simulation, one container can starve others, unrealistic behavior.
|
||||||
|
|
||||||
|
**Instead:** Always set limits matching simulated instance sizes.
|
||||||
|
|
||||||
|
## Scalability Considerations
|
||||||
|
|
||||||
|
| Concern | Single Student Lab | Classroom (20 students) | Online Course (1000+) |
|
||||||
|
|---------|-------------------|-------------------------|----------------------|
|
||||||
|
| **Docker Daemon** | Single instance sufficient | Local daemon per machine | Consider Docker-in-Docker or VMs |
|
||||||
|
| **Network Overhead** | Negligible | < 50 networks per host | Use network cleanup between labs |
|
||||||
|
| **Storage** | Named volumes on host | Same, per student machine | Cloud storage for container images |
|
||||||
|
| **Resource Limits** | Not critical | Important to prevent host OOM | Enforce quotas via Docker daemon limits |
|
||||||
|
|
||||||
|
### Build Order Implications
|
||||||
|
|
||||||
|
**Phase 1: Foundation (Prerequisites)**
|
||||||
|
1. Docker Engine + Docker Compose installation
|
||||||
|
2. Base network setup (public/private networks)
|
||||||
|
3. Volume structure creation
|
||||||
|
|
||||||
|
**Phase 2: IAM & Security (Lab 1)**
|
||||||
|
- Independent, can run parallel
|
||||||
|
- No dependencies on other labs
|
||||||
|
- Tests: user permissions, Docker socket access
|
||||||
|
|
||||||
|
**Phase 3: Network (Lab 2)**
|
||||||
|
- Depends on: Docker Engine understanding
|
||||||
|
- Enables: All subsequent labs
|
||||||
|
- Tests: Network isolation, DNS resolution
|
||||||
|
|
||||||
|
**Phase 4: Compute (Lab 3)**
|
||||||
|
- Depends on: Network (for service communication)
|
||||||
|
- Enables: Multi-tier applications
|
||||||
|
- Tests: Resource limits, health checks
|
||||||
|
|
||||||
|
**Phase 5: Storage (Lab 4)**
|
||||||
|
- Depends on: Network (for access patterns)
|
||||||
|
- Independent from: Compute
|
||||||
|
- Tests: Volume persistence, permissions
|
||||||
|
|
||||||
|
**Phase 6: Database (Lab 5)**
|
||||||
|
- Depends on: Network (VPC simulation), Storage (volumes)
|
||||||
|
- Culmination: Multi-tier architecture
|
||||||
|
- Tests: Cross-network communication, persistence
|
||||||
|
|
||||||
|
## Lab Environment Structure
|
||||||
|
|
||||||
|
### Recommended Directory Layout
|
||||||
|
|
||||||
|
```
|
||||||
|
laboratori-cloud/
|
||||||
|
├── .planning/ # Project planning
|
||||||
|
│ ├── PROJECT.md # Project requirements
|
||||||
|
│ └── research/ # Research documents
|
||||||
|
├── labs/ # Individual labs
|
||||||
|
│ ├── lab-01-iam/
|
||||||
|
│ │ ├── docker-compose.yml
|
||||||
|
│ │ ├── README.md # Tutorial
|
||||||
|
│ │ ├── how-to/ # How-to guides
|
||||||
|
│ │ ├── reference/ # Technical specs
|
||||||
|
│ │ ├── tests/ # Test scripts
|
||||||
|
│ │ │ ├── test-iam-setup.sh
|
||||||
|
│ │ │ └── verify-permissions.sh
|
||||||
|
│ │ └── docs/ # Explanation documents
|
||||||
|
│ ├── lab-02-network/
|
||||||
|
│ │ ├── docker-compose.yml
|
||||||
|
│ │ ├── networks.yml # Network definitions
|
||||||
|
│ │ ├── README.md
|
||||||
|
│ │ ├── tests/
|
||||||
|
│ │ │ ├── test-isolation.sh
|
||||||
|
│ │ │ └── test-routing.sh
|
||||||
|
│ │ └── docs/
|
||||||
|
│ ├── lab-03-compute/
|
||||||
|
│ │ ├── docker-compose.yml
|
||||||
|
│ │ ├── Dockerfile # Custom image
|
||||||
|
│ │ ├── README.md
|
||||||
|
│ │ ├── tests/
|
||||||
|
│ │ │ ├── test-resources.sh
|
||||||
|
│ │ │ └── test-oom.sh
|
||||||
|
│ │ └── docs/
|
||||||
|
│ ├── lab-04-storage/
|
||||||
|
│ │ ├── docker-compose.yml
|
||||||
|
│ │ ├── README.md
|
||||||
|
│ │ ├── tests/
|
||||||
|
│ │ │ ├── test-volumes.sh
|
||||||
|
│ │ │ └── test-minio.sh
|
||||||
|
│ │ └── docs/
|
||||||
|
│ └── lab-05-database/
|
||||||
|
│ ├── docker-compose.yml
|
||||||
|
│ ├── init.sql
|
||||||
|
│ ├── README.md
|
||||||
|
│ ├── tests/
|
||||||
|
│ │ ├── test-connectivity.sh
|
||||||
|
│ │ └── test-persistence.sh
|
||||||
|
│ └── docs/
|
||||||
|
├── shared/ # Shared resources
|
||||||
|
│ ├── base-images/ # Custom base images
|
||||||
|
│ ├── test-utils/ # Common test utilities
|
||||||
|
│ └── monitoring/ # Optional monitoring tools
|
||||||
|
├── ARCHITECTURE.md # This document
|
||||||
|
├── CLAUDE.md # Development manifesto
|
||||||
|
└── PRD.md # Product requirements
|
||||||
|
```
|
||||||
|
|
||||||
|
## Security Architecture
|
||||||
|
|
||||||
|
### Isolation Layers
|
||||||
|
|
||||||
|
1. **Host Level:** User namespaces, AppArmor profiles
|
||||||
|
2. **Network Level:** Bridge networks, iptables rules
|
||||||
|
3. **Container Level:** Non-root users, read-only filesystems
|
||||||
|
4. **Resource Level:** CPU/memory limits, disk quotas
|
||||||
|
|
||||||
|
### Authentication Simulation
|
||||||
|
|
||||||
|
```
|
||||||
|
Local IAM (Lab 1) Cloud IAM (Parallel)
|
||||||
|
├── Linux users ├── AWS IAM Users
|
||||||
|
├── Unix groups ├── IAM Groups
|
||||||
|
├── Docker socket permissions ├── IAM Roles
|
||||||
|
└── SSH key pairs ├── Access Keys
|
||||||
|
```
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
### HIGH Confidence (Official Documentation)
|
||||||
|
- Docker Networking Documentation - https://docs.docker.com/engine/network/ - Bridge networks, internal networks, DNS resolution
|
||||||
|
- Docker Compose Documentation - https://docs.docker.com/compose/ - Multi-container orchestration, service dependencies
|
||||||
|
- Docker Storage Documentation - https://docs.docker.com/storage/volumes/ - Named volumes, bind mounts, data persistence
|
||||||
|
- MinIO Documentation - https://min.io/docs/minio/linux/index.html - S3-compatible object storage for local simulation
|
||||||
|
|
||||||
|
### MEDIUM Confidence (Best Practices)
|
||||||
|
- Docker Security Best Practices - Container hardening, user namespaces
|
||||||
|
- Cloud Lab Environment Patterns - Educational infrastructure simulation
|
||||||
|
- Multi-stage Docker Builds - Image optimization for labs
|
||||||
|
|
||||||
|
### Project Context
|
||||||
|
- .planning/PROJECT.md - Project requirements and lab structure
|
||||||
|
- laboratori-cloud/prd.md - Detailed lab specifications and learning objectives
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Architecture research for: Docker-based Cloud Lab Environments*
|
||||||
|
*Researched: 2026-03-24*
|
||||||
199
.planning/research/FEATURES.md
Normal file
199
.planning/research/FEATURES.md
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
# Feature Landscape: Corsi Cloud con Laboratori Pratici
|
||||||
|
|
||||||
|
**Dominio:** Piattaforma educativa per cloud con laboratori pratici basati su Docker
|
||||||
|
**Ricercato:** 2026-03-24
|
||||||
|
**Confidenza:** MEDIUM (basato su analisi di piattaforme esistenti + esperienza nel settore)
|
||||||
|
|
||||||
|
## Feature Landscape
|
||||||
|
|
||||||
|
### Table Stakes (Gli Utenti Si Aspettano Questi)
|
||||||
|
|
||||||
|
Funzionalità che gli studenti assumono come scontate. Senza queste, il corso appare incompleto.
|
||||||
|
|
||||||
|
| Feature | Perché È Attesa | Complessità | Note |
|
||||||
|
|---------|-----------------|-------------|------|
|
||||||
|
| **Istruzioni passo-passo** | Gli studenti devono seguire senza ambiguity | Low | Tutorial chiari comandi esatti da eseguire |
|
||||||
|
| **Ambiente di test funzionante** | "Funziona sul mio PC" non è accettabile per cloud | Medium | Docker Compose deve partire senza errori |
|
||||||
|
| **Verifica del lavoro svolto** | Studenti devono confermare di aver completato correttamente | Medium | Script di test automatici (curl, nc, docker ps) |
|
||||||
|
| **Parallelismo Cloud ↔ Locale** | Il corso deve insegnare cloud, non solo Docker | High | Ogni concetto Docker = servizio cloud corrispondente |
|
||||||
|
| **Troubleshooting di base** | Gli studenti incontrano problemi, necessitano guida | Medium | Lista errori comuni e soluzioni |
|
||||||
|
| **Requisiti chiari** | Frustrazione se ambiente non è compatibile | Low | Versioni Docker, OS, risorse minime |
|
||||||
|
| **Tempo stimato per laboratorio** | Gestione delle aspettative su durata | Low | 1-3 ore per lab è tipico nel settore |
|
||||||
|
| **Ripristino ambiente** | Errori devono essere correggibili senza reinstallare | Medium | Comandi per resetare/volume cleanup |
|
||||||
|
|
||||||
|
### Differentiators (Vantaggio Competitivo)
|
||||||
|
|
||||||
|
Funzionalità che distinguono questo corso dalle alternative.
|
||||||
|
|
||||||
|
| Feature | Valore Unico | Complessità | Note |
|
||||||
|
|---------|--------------|-------------|------|
|
||||||
|
| **Assolutamente ZERO costi cloud** | Nessun rischio bollette AWS/Azure | Low | Solo Docker locale, niente account cloud reali |
|
||||||
|
| **Safety-first per eccellenza** | Best practices sicurezza insegnate per imprinting | High | Least privilege, isolamento reti, limiti risorse |
|
||||||
|
| **Framework Diátaxis completo** | Tutti gli stili di apprendimento coperti | Medium | Tutorial + How-to + Reference + Explanation per OGNI lab |
|
||||||
|
| **Test-Driven Infrastructure (TDI)** | Metodo professionale, non solo "fare cose" | Medium | RED→GREEN→REFACTOR per ogni infrastruttura |
|
||||||
|
| **Incrementalità progettata** | Architettura complessa costruita passo passo | High | Lab 1-5 costruiscono progressivamente sistema completo |
|
||||||
|
| **Approccio "Little Often"** | Evita overwhelmin, favorende retenzione | Low | Concetti piccoli, frequente pratica |
|
||||||
|
| **Double Check esplicito** | Insegna verifica sistematica del lavoro | Medium | Checklist pre-commit per ogni laboratorio |
|
||||||
|
| **Architettura locale mappata 1:1** | Docker Networks → VPC, MinIO → S3, PostgreSQL → RDS | High | Mappatura esplicita documentata in Explanation |
|
||||||
|
| **Script di test inclusi** | Studenti imparano a validare il proprio lavoro | Medium | Test bash che verificano requisiti prima di proseguire |
|
||||||
|
| **Git workflow professionale** | Insegna convenzioni industriali reali | Low | Conventional commits, branches per lab |
|
||||||
|
|
||||||
|
### Anti-Features (Da Evitare Esplicitamente)
|
||||||
|
|
||||||
|
Funzionalità spesso richieste ma che creano problemi.
|
||||||
|
|
||||||
|
| Feature | Perché Richiesta | Perché Problematica | Alternativa |
|
||||||
|
|---------|------------------|---------------------|-------------|
|
||||||
|
| **Account cloud reali** | "Voglio esperienza vera su AWS" | Costi incontrollabili, complessità onboarding, rischio errori prod | Simulazione locale con Docker + mappatura concettuale |
|
||||||
|
| **Video streaming integrato** | "Voglio vedere fare prima di fare" | Complessità tecnica, bandwidth, non scalabile, distoglie dal DOING | Tutorial testuali con comandi esatti da eseguire |
|
||||||
|
| **Piattaforma web custom** | "Voglio un portale bello" | Sviluppo frontend, auth, hosting = distrazione dal valore educativo | Repository Git + markdown per materiali |
|
||||||
|
| **Lab multi-user collaborativi** | "Voglio lavorare in team" | Complessità infrastrutturale enorme, conflitti, debugging difficile | Laboratori individuali con condivisione risultati via Git |
|
||||||
|
| **Mobile apps** | "Voglio studiare sul telefono" | Comandi Docker su mobile = esperienza terribile, inutile per questo tipo di learning | Focus su desktop/laptop dove Docker gira realmente |
|
||||||
|
| **AI/Chatbot integrato** | "Voglio un assistente AI" | Costo, complessità manutenzione, spesso fornisce risposte sbagliate | Troubleshooting guide scritte da esperti umani |
|
||||||
|
| **Gamification eccessiva** | "Voglio badge e punteggi" | Distrazione dal learning reale, gamification wearing off fast | Soddisfazione di completare lab complessi + certificazione |
|
||||||
|
|
||||||
|
## Feature Dependencies
|
||||||
|
|
||||||
|
```
|
||||||
|
[Lab 1: IAM & Sicurezza]
|
||||||
|
└──richiesto da──> [Lab 2: Network] (utenti/gruppi per permessi Docker)
|
||||||
|
└──richiesto da──> [Lab 5: Database] (isolamento privato)
|
||||||
|
|
||||||
|
[Lab 2: Network] (Docker Networks)
|
||||||
|
└──richiesto da──> [Lab 3: Compute] (reti isolate per web server)
|
||||||
|
└──richiesto da──> [Lab 5: Database] (VPC privata)
|
||||||
|
|
||||||
|
[Lab 3: Compute] (Container con limiti)
|
||||||
|
└──richiesto da──> [Lab 4: Storage] (container app che usano storage)
|
||||||
|
|
||||||
|
[Lab 4: Storage] (MinIO + Volumes)
|
||||||
|
└──potenzia──> [Lab 5: Database] (persistenza DB)
|
||||||
|
|
||||||
|
[Framework Diátaxis]
|
||||||
|
└──richiesto per──> [Tutti i Lab] (documentazione obbligatoria)
|
||||||
|
|
||||||
|
[Script di Test TDI]
|
||||||
|
└──richiesto per──> [Tutti i Lab] (validazione infrastruttura)
|
||||||
|
|
||||||
|
[Git Workflow]
|
||||||
|
└──potenzia──> [Tutti i Lab] (tracciamento lavoro studente)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dependency Notes
|
||||||
|
|
||||||
|
- **Lab 1 richiede che gli studenti comprendano utenti Linux e permessi** senza questo, i laboratori successivi su Docker socket access falliscono
|
||||||
|
- **Lab 2 (Network) è prerequisito critico per Lab 5 (Database)** perché il DB deve essere in rete privata, accessibilità solo da application layer
|
||||||
|
- **Framework Diátaxis è orizzontale a tutti i laboratori** non è sequenziale ma ogni lab DEVE avere i 4 documenti completi
|
||||||
|
- **Script di test TDI sono preventivi non successivi** si scrive PRIMA il test, poi l'infrastruttura
|
||||||
|
- **Git workflow è abilitante, non dipendenza** permette versioning ma non blocca l'apprendimento se saltato
|
||||||
|
|
||||||
|
## MVP Definition
|
||||||
|
|
||||||
|
### Launch Con (v1 - 5 Lab Core)
|
||||||
|
|
||||||
|
Prodotto minimo viable per validare il concetto.
|
||||||
|
|
||||||
|
- [ ] **Lab 1: IAM & Sicurezza** — Fondamentale per tutti i laboratori successivi (permessi Docker)
|
||||||
|
- [ ] **Lab 2: Network** — Concetto chiave cloud (VPC) + prerequisito per Lab 3-5
|
||||||
|
- [ ] **Lab 3: Compute** — Simula EC2/VM con container + limiti risorse
|
||||||
|
- [ ] **Lab 4: Storage** — Simula S3 (MinIO) + Block Storage (Volumes)
|
||||||
|
- [ ] **Lab 5: Database** — Simula RDS in rete privata (integrazione di tutti i concetti)
|
||||||
|
- [ ] **Framework Diátaxis per OGNI lab** — 4 documenti (Tutorial, How-to, Reference, Explanation)
|
||||||
|
- [ ] **Script di test per OGNI lab** — Verifica automatica requisiti
|
||||||
|
- [ ] **Parallelismo Cloud ↔ Locale documentato** — Every Docker component mapped to cloud service
|
||||||
|
- [ ] **Requisiti e troubleshooting per OGNI lab** — Setup instructions + error resolution
|
||||||
|
|
||||||
|
### Add After Validation (v1.x)
|
||||||
|
|
||||||
|
Funzionalità da aggiungere una volta validato il core.
|
||||||
|
|
||||||
|
- [ ] **Soluzioni ufficiali** — Trigger: richiesta ricorrente degli studenti per verificare il proprio lavoro
|
||||||
|
- [ ] **Script di auto-correzione** — Trigger: studenti che non riescono a capire dove sbagliano
|
||||||
|
- [ ] **Challenge labs opzionali** — Trigger: feedback "troppo facile" da studenti avanzati
|
||||||
|
- [ ] **Versioni multi-cloud** — Trigger: richiesta di paralleli Azure/GCP oltre ad AWS
|
||||||
|
- [ ] **VM pre-configurata** — Trigger: studenti con problemi di setup ambiente locale
|
||||||
|
|
||||||
|
### Future Consideration (v2+)
|
||||||
|
|
||||||
|
Funzionalità da rimandare a product-market fit stabile.
|
||||||
|
|
||||||
|
- [ ] **Progress tracking integrato** — Perché: richiede backend/database, complessità non essenziale per v1
|
||||||
|
- [ ] **Certification exam prep** — Perché: richiede allineamento con esami vendor-specific, enorme lavoro di contenuto
|
||||||
|
- [ ] **Community features** — Perché: forum, chat, peer review = moderation overhead, distrazione dal core
|
||||||
|
- [ ] **Instructor dashboard** — Perché: richiede multi-tenancy, analytics, subscription management
|
||||||
|
- [ ] **Enterprise features** — Perché: SSO, team reporting, custom labs = mercato diverso, vendite diverse
|
||||||
|
|
||||||
|
## Feature Prioritization Matrix
|
||||||
|
|
||||||
|
| Feature | Valore Utente | Costo Implementazione | Priorità |
|
||||||
|
|---------|---------------|----------------------|----------|
|
||||||
|
| Lab 1: IAM & Sicurezza | HIGH | Medium | **P1** |
|
||||||
|
| Lab 2: Network | HIGH | High | **P1** |
|
||||||
|
| Lab 3: Compute | HIGH | Medium | **P1** |
|
||||||
|
| Lab 4: Storage | HIGH | Medium | **P1** |
|
||||||
|
| Lab 5: Database | HIGH | High | **P1** |
|
||||||
|
| Framework Diátaxis (4 doc per lab) | HIGH | High | **P1** |
|
||||||
|
| Script di test TDI | HIGH | Medium | **P1** |
|
||||||
|
| Parallelismo Cloud↔Locale | HIGH | High | **P1** |
|
||||||
|
| Troubleshooting guides | HIGH | Low | **P1** |
|
||||||
|
| Soluzioni ufficiali | MEDIUM | Medium | **P2** |
|
||||||
|
| Challenge labs opzionali | MEDIUM | High | **P2** |
|
||||||
|
| VM pre-configurata | MEDIUM | Medium | **P2** |
|
||||||
|
| Auto-correzione scripts | MEDIUM | High | **P2** |
|
||||||
|
| Versioni multi-cloud | LOW | Very High | **P3** |
|
||||||
|
| Progress tracking | LOW | Very High | **P3** |
|
||||||
|
| Community features | LOW | Very High | **P3** |
|
||||||
|
| Certification exam prep | MEDIUM | Very High | **P3** |
|
||||||
|
| Instructor dashboard | LOW | Very High | **P3** |
|
||||||
|
|
||||||
|
**Chiave priorità:**
|
||||||
|
- **P1:** Must have per launch (core value proposition)
|
||||||
|
- **P2:** Should have, aggiungere quando possibile (enhancement)
|
||||||
|
- **P3:** Nice to have, considerazione futura (scalability)
|
||||||
|
|
||||||
|
## Competitor Feature Analysis
|
||||||
|
|
||||||
|
| Feature | AWS Skill Builder | Azure Lab Services | KodeKloud | A Cloud Guru | Il Nostro Corso |
|
||||||
|
|---------|-------------------|-------------------|-----------|--------------|----------------|
|
||||||
|
| **Hands-on labs** | Reali AWS sandbox | Azure temporanei | Browser-based | Cloud sandboxes | Docker locale (FREE) |
|
||||||
|
| **Costo per studente** | Alto (risorse AWS) | Alto (risorse Azure) | Subscription | Subscription | ZERO (solo Docker) |
|
||||||
|
| **Parallelismo esplicito** | Implicito (uso AWS) | Implicito (uso Azure) | Implicito | Implicito | **ESPlicitO documentato** |
|
||||||
|
| **Framework Diátaxis** | No | No | No | No | **SÌ, obbligatorio** |
|
||||||
|
| **Test-Driven Learning** | No | No | Parziale | No | **SÌ, TDI completo** |
|
||||||
|
| **Sicurezza enforcement** | Gestita da AWS | Gestita da Azure | Parziale | Parziale | **Esplicito insegnato** |
|
||||||
|
| **Troubleshooting guides** | Base | Base | Disponibili | Base | **Integrato in ogni lab** |
|
||||||
|
| **Multi-cloud** | AWS only | Azure only | Multi | Multi | **Fondamenti prima** |
|
||||||
|
| **Offline capability** | No | No | No | No | **SÌ, completamente** |
|
||||||
|
| **Git workflow professionale** | No | No | No | No | **SÌ, Conventional Commits** |
|
||||||
|
| **Reset environment** | Automatico (cloud) | Automatico (cloud) | Clic | Clic | **Comando locale** |
|
||||||
|
| **Time-limited sessions** | SÌ (costo) | SÌ (costo) | No | No | **NO (illimitato)** |
|
||||||
|
|
||||||
|
**Il Nostro Vantaggio Chiave:**
|
||||||
|
- **ZERO costi** → Nessun rischio bollette, esperimenti illimitati
|
||||||
|
- **Approccio pedagogico superiore** → Diátaxis + TDI + Double Check
|
||||||
|
- **Security-first imprinting** → Insegna best practices per carriera enterprise
|
||||||
|
- **Parallelismo esplicito** → Concetti cloud trasferibili ad AWS/Azure/GCP
|
||||||
|
- **Completamente offline** → Studia ovunque, senza connessione
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
### Piattaforme Analizzate
|
||||||
|
- [Google Cloud Skills Boost](https://www.cloudskillsboost.google/) — Focus su gamification, skill badges, timed labs
|
||||||
|
- [KodeKloud](https://kodekloud.com) — Hands-on labs browser-based, playgrounds, AI tutor, sandbox environments
|
||||||
|
- [A Cloud Guru (Pluralsight)](https://www.acloudguru.com) — 400+ courses, 1,800+ labs, cloud sandboxes, practice exams
|
||||||
|
|
||||||
|
### Confidenza Fonti
|
||||||
|
- **HIGH:** Analisi diretta siti web ufficiali sopra citati
|
||||||
|
- **MEDIUM:** Esperienza settore formazione tecnica + best practices cloud education
|
||||||
|
- **LOW:** Nessuna fonte bassa confidenza utilizzata
|
||||||
|
|
||||||
|
### Gap di Ricerca
|
||||||
|
- **Analisi feedback studenti reali** → Non disponibile senza dati usage
|
||||||
|
- **Confronto costi dettagliato** → Richiederebbe accesso pricing enterprise competitor
|
||||||
|
- **Effectiveness measurement** → Studi learning effectiveness non disponibili pubblicamente
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Feature research per: Corsi Cloud con Laboratori Pratici*
|
||||||
|
*Ricercato: 2026-03-24*
|
||||||
|
*Confidenza: MEDIUM*
|
||||||
338
.planning/research/PITFALLS.md
Normal file
338
.planning/research/PITFALLS.md
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
# Domain Pitfalls
|
||||||
|
|
||||||
|
**Domain:** Cloud Lab Projects with Docker Simulation
|
||||||
|
**Researched:** 2026-03-24
|
||||||
|
**Overall confidence:** HIGH (based on official Docker documentation and educational best practices)
|
||||||
|
|
||||||
|
## Critical Pitfalls
|
||||||
|
|
||||||
|
### Pitfall 1: Data Loss on Container Restart
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Students lose all their work when containers are restarted or removed. Database data, uploaded files, and configuration changes disappear because data was written to the container's writable layer instead of volumes.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- Beginners don't understand Docker's layered filesystem
|
||||||
|
- Tutorials often skip volume configuration for simplicity
|
||||||
|
- The difference between `docker stop` vs `docker rm` isn't clear
|
||||||
|
- Anonymous volumes vs named volumes confusion
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Always use named Docker volumes for persistent data
|
||||||
|
- Explicitly declare volumes in `docker-compose.yml` under the top-level `volumes` key
|
||||||
|
- Teach volume lifecycle: volumes persist after container removal
|
||||||
|
- Use `--mount` flag syntax (more explicit) instead of `-v` for beginners
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- No top-level `volumes:` section in docker-compose.yml
|
||||||
|
- Using inline volume paths like `./data:/app/data` without explaining persistence
|
||||||
|
- Labs that work once but fail on restart
|
||||||
|
- Students asking "where did my data go?"
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 1 (IAM & Sicurezza) - Introduce volume concepts early
|
||||||
|
Lab 4 (Storage) - Critical for object storage persistence
|
||||||
|
Lab 5 (Database) - Essential for database data persistence
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Pitfall 2: Networking Confusion - Localhost vs Container Names
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Students try to connect to services using `localhost` or `127.0.0.1` instead of container service names. Connections fail because containers have isolated network stacks.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- Mental model from local development doesn't translate to containers
|
||||||
|
- Docker's embedded DNS isn't explained
|
||||||
|
- Students don't understand that each container has its own `localhost`
|
||||||
|
- Confusion between exposed ports and published ports
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Teach Docker's internal DNS resolution first
|
||||||
|
- Always use service names for inter-container communication
|
||||||
|
- Create network diagrams showing container isolation
|
||||||
|
- Explain `EXPOSE` (docs) vs `-p` (publish) difference clearly
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- Connection refused errors when using localhost
|
||||||
|
- Students asking "why can't I connect to the database?"
|
||||||
|
- Mixing up `localhost` inside container vs `localhost` on host
|
||||||
|
- Port mapping confusion (internal vs external ports)
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 2 (Network) - Core networking concepts
|
||||||
|
Lab 5 (Database) - Application-to-database connections
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Pitfall 3: OOM Killer - Resource Exhaustion
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Containers or the entire Docker daemon are killed by the kernel's OOM (Out Of Memory) killer. Students lose work and the lab environment becomes unstable.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- No memory limits set in docker-compose
|
||||||
|
- Multiple containers compete for host memory
|
||||||
|
- Students' machines have limited RAM (8GB or less)
|
||||||
|
- Memory leaks in student code go unchecked
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Always set `mem_limit` in docker-compose for each service
|
||||||
|
- Use `deploy.resources.limits.memory` in compose file format v3+
|
||||||
|
- Monitor with `docker stats`
|
||||||
|
- Teach students to check container resource usage
|
||||||
|
- Provide minimum host requirements (16GB RAM recommended)
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- Containers randomly exit with code 137
|
||||||
|
- Host system becomes slow
|
||||||
|
- `docker ps` shows containers restarting repeatedly
|
||||||
|
- System logs mention "OOM killer"
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 3 (Compute) - Resource limits are essential here
|
||||||
|
All labs - Enforce resource limits from the start
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Pitfall 4: Security Misconfiguration - Running as Root
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Containers run as root by default, creating security vulnerabilities and permission issues with volume mounts.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- Docker's default behavior is root unless specified otherwise
|
||||||
|
- Base images often set `USER root`
|
||||||
|
- Beginners don't understand Linux user permissions
|
||||||
|
- Volume permission errors seem "easier" to fix with root
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Always specify `user:` directive in docker-compose or Dockerfile
|
||||||
|
- Create non-root users in Dockerfiles
|
||||||
|
- Teach Linux permission basics alongside Docker
|
||||||
|
- Use Docker's user namespaces for advanced labs
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- Permission denied errors with volumes
|
||||||
|
- Files created as root on host system
|
||||||
|
- Security warnings in `docker inspect`
|
||||||
|
- Running commands with `sudo` inside containers
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 1 (IAM & Sicurezza) - User permissions and security basics
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Pitfall 5: Port Conflicts and Binding Issues
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Multiple students' labs conflict when using default ports. Services fail to start because ports are already in use.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- Hardcoded default ports (3306, 5432, 8080, etc.)
|
||||||
|
- Multiple labs running simultaneously
|
||||||
|
- Not teaching port mapping flexibility
|
||||||
|
- Students don't know how to check occupied ports
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Use non-standard ports in examples (e.g., 5433 instead of 5432)
|
||||||
|
- Teach students to check port usage: `netstat -tuln` or `ss -tuln`
|
||||||
|
- Document all port mappings in lab materials
|
||||||
|
- Provide scripts to detect port conflicts
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- "port already allocated" errors
|
||||||
|
- Services failing to start silently
|
||||||
|
- Students reporting "it worked yesterday but not today"
|
||||||
|
- Multiple labs can't run simultaneously
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 2 (Network) - Port mapping and exposure
|
||||||
|
All labs - Use unique port ranges per lab
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Pitfall 6: depends_on Without Readiness Checks
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Services start but fail because dependencies aren't ready. Applications crash trying to connect to databases that are still initializing.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- `depends_on` only waits for containers to start, not be ready
|
||||||
|
- Databases need time to initialize (can take 10-30 seconds)
|
||||||
|
- No healthcheck or readiness probe configured
|
||||||
|
- Students assume "started" = "ready to accept connections"
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Implement healthchecks for all services
|
||||||
|
- Use restart policies with delays
|
||||||
|
- Teach the difference between "running" and "healthy"
|
||||||
|
- Provide example healthcheck scripts for common services
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- Intermittent connection failures on lab startup
|
||||||
|
- "Connection refused" errors that go away with manual retry
|
||||||
|
- Services exiting and restarting
|
||||||
|
- Need to manually restart containers to make things work
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 3 (Compute) - Health checks and service readiness
|
||||||
|
Lab 5 (Database) - Database initialization timing
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Pitfall 7: Orphaned Resources - Disk Space Exhaustion
|
||||||
|
|
||||||
|
**What goes wrong:**
|
||||||
|
Students' disk space fills up with stopped containers, unused volumes, and dangling images. Docker becomes unusable.
|
||||||
|
|
||||||
|
**Why it happens:**
|
||||||
|
- Students never clean up resources
|
||||||
|
- No teaching of `docker system prune`
|
||||||
|
- Volumes aren't removed when containers are deleted
|
||||||
|
- Image layers accumulate during development
|
||||||
|
|
||||||
|
**How to avoid:**
|
||||||
|
- Teach cleanup commands in every lab
|
||||||
|
- Provide cleanup scripts
|
||||||
|
- Use `--rm` flag for one-off containers
|
||||||
|
- Explain volume lifecycle and manual removal
|
||||||
|
- Monitor disk usage in lab instructions
|
||||||
|
|
||||||
|
**Warning signs:**
|
||||||
|
- Disk space warnings on host system
|
||||||
|
- `docker system df` shows large unused space
|
||||||
|
- Slow container startup due to image bloat
|
||||||
|
- "No space left on device" errors
|
||||||
|
|
||||||
|
**Phase to address:**
|
||||||
|
Lab 1 (IAM & Sicurezza) - Docker basics and cleanup
|
||||||
|
All labs - Include cleanup section in each lab
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Technical Debt Patterns
|
||||||
|
|
||||||
|
Shortcuts that seem reasonable but create long-term problems.
|
||||||
|
|
||||||
|
| Shortcut | Immediate Benefit | Long-term Cost | When Acceptable |
|
||||||
|
|----------|-------------------|----------------|-----------------|
|
||||||
|
| Using `--privileged` flag | Fixes permission issues quickly | Major security hole, teaches bad practices | NEVER in educational context |
|
||||||
|
| Hardcoding IPs in configs | Works immediately for one student | Doesn't scale, breaks on different machines | NEVER - use service names |
|
||||||
|
| Using `network_mode: host` | Simplifies networking | Breaks isolation, conflicts between labs | Only for debugging, never in final labs |
|
||||||
|
| Anonymous volumes | Less configuration | Data loss, difficult cleanup | NEVER - always use named volumes |
|
||||||
|
| Ignoring healthchecks | Faster startup | Flaky services, difficult debugging | NEVER - causes intermittent failures |
|
||||||
|
| Using latest tags | No version numbers to track | Unexpected breaking changes | NEVER - use specific versions |
|
||||||
|
| Exposing all ports | "It just works" | Security issues, port conflicts | NEVER - expose only what's needed |
|
||||||
|
|
||||||
|
## Integration Gotchas
|
||||||
|
|
||||||
|
Common mistakes when connecting to external services.
|
||||||
|
|
||||||
|
| Integration | Common Mistake | Correct Approach |
|
||||||
|
|-------------|----------------|------------------|
|
||||||
|
| MinIO (S3) | Using AWS endpoint `s3.amazonaws.com` | Use `http://localhost:9000` or container service name |
|
||||||
|
| MinIO Console | Confusing port 9000 (API) with 9001 (Console) | Document both ports clearly, separate service configs |
|
||||||
|
| PostgreSQL | Using default port 5432 (causes conflicts) | Use 5433 or other non-standard port |
|
||||||
|
| MySQL | Not setting `MYSQL_ROOT_PASSWORD` env var | Always set required environment variables |
|
||||||
|
| Redis | Using default port 6379 (may conflict) | Use non-standard port or proper networking |
|
||||||
|
| Networks | Using legacy `--link` flag | Use user-defined networks and service names |
|
||||||
|
| Volumes | Bind mounting to non-existent host paths | Create host directories first or use named volumes |
|
||||||
|
| DNS | Using `/etc/hosts` inside containers | Use Docker's embedded DNS with service names |
|
||||||
|
|
||||||
|
## Performance Traps
|
||||||
|
|
||||||
|
Patterns that work at small scale but fail as usage grows.
|
||||||
|
|
||||||
|
| Trap | Symptoms | Prevention | When It Breaks |
|
||||||
|
|------|----------|------------|----------------|
|
||||||
|
| No resource limits | Works with 1-2 containers, host crashes at 5+ | Always set CPU and memory limits | 3-5 containers on 8GB RAM |
|
||||||
|
| Single bridge network | Fine for simple apps, confusing for complex | Use multiple networks for isolation | 5+ services with different security needs |
|
||||||
|
| tmpfs for data | Fast but data loss on restart | Use named volumes for persistence | Immediately on container restart |
|
||||||
|
| Logging to json-file without rotation | Works initially, disk fills up | Set `max-size` and `max-file` options | After running labs repeatedly |
|
||||||
|
| Building images in Compose | Slow rebuilds, large layers | Use multi-stage builds, .dockerignore | After 3-4 iterations |
|
||||||
|
| Running everything on default network | Works until naming conflicts arise | Use custom networks per lab | When running multiple labs simultaneously |
|
||||||
|
|
||||||
|
## Security Mistakes
|
||||||
|
|
||||||
|
Domain-specific security issues beyond general web security.
|
||||||
|
|
||||||
|
| Mistake | Risk | Prevention |
|
||||||
|
|---------|------|------------|
|
||||||
|
| Mounting Docker socket (`/var/run/docker.sock`) | Container breakout, root on host | NEVER do this in educational context |
|
||||||
|
| Running containers as root | Privilege escalation vulnerabilities | Always use `user:` directive |
|
||||||
|
| Exposing all ports to 0.0.0.0 | Services accessible externally | Bind to 127.0.0.1 or use internal networks |
|
||||||
|
| Using default credentials | Easy unauthorized access | Require password changes, document security |
|
||||||
|
| Sharing host PID namespace | Container can see host processes | Never use `pid: host` in labs |
|
||||||
|
| Ignoring cgroups | No resource isolation = DoS potential | Always set resource limits |
|
||||||
|
| Using `--privileged` flag | Complete host access | NEVER acceptable, teaches bad practices |
|
||||||
|
| Not using AppArmor/SELinux profiles | Missing security layer | Enable when available, document why |
|
||||||
|
|
||||||
|
## UX Pitfalls
|
||||||
|
|
||||||
|
Common user experience mistakes in this domain.
|
||||||
|
|
||||||
|
| Pitfall | User Impact | Better Approach |
|
||||||
|
|---------|-------------|-----------------|
|
||||||
|
| Silent failures | Students don't know what went wrong | Always provide error messages and logs |
|
||||||
|
| No progress indicators | Students think labs are broken | Show startup progress, especially for databases |
|
||||||
|
| Hidden dependencies | Labs fail mysteriously | List all prerequisites clearly, check at startup |
|
||||||
|
| Complex YAML errors | Students stuck on syntax | Validate YAML before running, provide examples |
|
||||||
|
| No rollback capability | Mistakes require starting over | Git version control, snapshot instructions |
|
||||||
|
| Missing cleanup steps | Accumulating cruft, confusion | Provide cleanup scripts for each lab |
|
||||||
|
| Unclear parallelisms | Students don't see the point | Explicitly map Docker concepts to AWS services |
|
||||||
|
| Assuming prior knowledge | Beginners get lost | Provide background reading, glossary of terms |
|
||||||
|
|
||||||
|
## "Looks Done But Isn't" Checklist
|
||||||
|
|
||||||
|
Things that appear complete but are missing critical pieces.
|
||||||
|
|
||||||
|
- [ ] **Volume Persistence:** Often missing named volume declarations — verify data survives `docker down` and `docker up`
|
||||||
|
- [ ] **Network Isolation:** Often missing network per lab — verify containers can't accidentally talk between labs
|
||||||
|
- [ ] **Health Checks:** Often missing readiness verification — verify `docker ps` shows "healthy" not just "running"
|
||||||
|
- [ ] **Resource Limits:** Often missing CPU/memory constraints — verify `docker stats` shows limits
|
||||||
|
- [ ] **Cleanup Scripts:** Often missing tear-down instructions — verify `docker system df` is clean after lab
|
||||||
|
- [ ] **Error Handling:** Often missing graceful failure modes — verify lab handles common errors (port conflicts, missing volumes)
|
||||||
|
- [ ] **Cloud Parallels:** Often missing explicit mappings — verify each Docker component maps to a specific AWS service
|
||||||
|
- [ ] **Diátaxis Documentation:** Often missing explanation documents — verify each lab has all 4 document types
|
||||||
|
|
||||||
|
## Recovery Strategies
|
||||||
|
|
||||||
|
When pitfalls occur despite prevention, how to recover.
|
||||||
|
|
||||||
|
| Pitfall | Recovery Cost | Recovery Steps |
|
||||||
|
|---------|---------------|----------------|
|
||||||
|
| Data loss from missing volumes | HIGH | Rebuild from scratch, add volumes, restore from backup if available |
|
||||||
|
| OOM killer crash | MEDIUM | Add memory limits to all services, restart Docker daemon, free host memory |
|
||||||
|
| Port conflicts | LOW | Change port mappings, kill conflicting processes, restart services |
|
||||||
|
| Permission errors | MEDIUM | Add `user:` directive, chown volume directories, rebuild containers |
|
||||||
|
| Network connectivity issues | LOW | Verify service names, check network attachment, ping between containers |
|
||||||
|
| Disk space exhaustion | HIGH | Run `docker system prune -a`, remove unused volumes, clear build cache |
|
||||||
|
| Orphaned containers | LOW | Run `docker container prune`, remove stopped containers manually |
|
||||||
|
|
||||||
|
## Pitfall-to-Phase Mapping
|
||||||
|
|
||||||
|
How roadmap phases should address these pitfalls.
|
||||||
|
|
||||||
|
| Pitfall | Prevention Phase | Verification |
|
||||||
|
|---------|------------------|--------------|
|
||||||
|
| Data loss on restart | Lab 1 - IAM & Sicurezza (introduce volumes), Lab 4 - Storage (critical) | Verify: `docker down` then `docker up` preserves data |
|
||||||
|
| Networking confusion | Lab 2 - Network (core concepts), Lab 5 - Database (application connections) | Verify: Service names resolve, inter-container communication works |
|
||||||
|
| OOM killer | Lab 3 - Compute (resource limits mandatory) | Verify: `docker stats` shows limits, no OOM errors under load |
|
||||||
|
| Running as root | Lab 1 - IAM & Sicurezza (user permissions) | Verify: `docker exec -it <container> whoami` shows non-root user |
|
||||||
|
| Port conflicts | Lab 2 - Network (port mapping), All labs (unique ports) | Verify: Multiple labs can run simultaneously without errors |
|
||||||
|
| depends_on without readiness | Lab 3 - Compute (healthchecks), Lab 5 - Database (initialization) | Verify: All services show "healthy" before app tries to connect |
|
||||||
|
| Orphaned resources | Lab 1 - IAM & Sicurezza (cleanup commands), All labs (cleanup section) | Verify: `docker system df` shows minimal unused space after cleanup |
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
- [Docker Engine Security Documentation](https://docs.docker.com/engine/security/) - HIGH confidence, official Docker security best practices
|
||||||
|
- [Docker Volumes Documentation](https://docs.docker.com/storage/volumes/) - HIGH confidence, official volume management reference
|
||||||
|
- [Docker Compose File v3 Reference](https://docs.docker.com/compose/compose-file/compose-file-v3/) - HIGH confidence, official Compose specification
|
||||||
|
- Docker documentation on resource limits and OOM prevention
|
||||||
|
- Common educational patterns from container-based training courses
|
||||||
|
- Known issues from Docker-based learning environments
|
||||||
|
|
||||||
|
---
|
||||||
|
*Pitfalls research for: Cloud Lab Projects with Docker Simulation*
|
||||||
|
*Researched: 2026-03-24*
|
||||||
149
.planning/research/STACK.md
Normal file
149
.planning/research/STACK.md
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
# Technology Stack
|
||||||
|
|
||||||
|
**Project:** Laboratori Cloud - Corso Soluzioni Cloud
|
||||||
|
**Researched:** 2026-03-24
|
||||||
|
**Overall confidence:** HIGH
|
||||||
|
|
||||||
|
## Recommended Stack
|
||||||
|
|
||||||
|
### Core Framework
|
||||||
|
|
||||||
|
| Technology | Version | Purpose | Why |
|
||||||
|
|------------|---------|---------|-----|
|
||||||
|
| Docker Engine | 28.0+ | Orchestrazione container | Standard mercato, isolamento nativo, supporto rootless per sicurezza |
|
||||||
|
| Docker Compose | V2.36.2+ | Definizione multi-container | Sintassi declarativa, gestione reti/volumi nativa, integrazione con Docker Engine v28 |
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
| Technology | Version | Purpose | Why |
|
||||||
|
|------------|---------|---------|-----|
|
||||||
|
| PostgreSQL | 18.x | Database relazionale | Simula RDS/Aurora, open-source standard, supporto ACID completo |
|
||||||
|
| MySQL | 9.x | Database relazionale (alternativa) | Simula RDS MySQL, popolare in produzione, compatibilità ampia |
|
||||||
|
|
||||||
|
### Storage
|
||||||
|
|
||||||
|
| Technology | Version | Purpose | Why |
|
||||||
|
|------------|---------|---------|-----|
|
||||||
|
| Docker Volumes | Native | Block storage persistente | Simula EBS, sopravvive a container restart, gestione nativa |
|
||||||
|
| MinIO | RELEASE.2025-05-24T17-08-30Z | Object storage S3-compatible | Compatibilità 100% API S3, leggero per locale, CLI identica ad AWS |
|
||||||
|
|
||||||
|
### Networking
|
||||||
|
|
||||||
|
| Technology | Version | Purpose | Why |
|
||||||
|
|------------|---------|---------|-----|
|
||||||
|
| Docker Bridge Networks | Native | Isolamento reti locali | Simulano VPC/Subnets, isolamento kernel-level, supporto iptables |
|
||||||
|
| iptables | Linux standard | NAT e firewall rules | Simula NAT Gateway, Security Groups, controllo granulare traffico |
|
||||||
|
|
||||||
|
### Supporting Libraries
|
||||||
|
|
||||||
|
| Library | Version | Purpose | When to Use |
|
||||||
|
|---------|---------|---------|-------------|
|
||||||
|
| docker-compose-test | N/A | Validazione configurazioni | Verifica sintassi compose PRIMA dell'esecuzione |
|
||||||
|
| netcat-openbsd | 1.219+ | Diagnostica porte | Test connettività tra container, verifica firewall rules |
|
||||||
|
| curl | 8.x+ | HTTP/HTTPS testing | Validate web server endpoints, API calls |
|
||||||
|
| pg_isready | PostgreSQL bundled | Health check database | Verifica che DB sia pronto prima di connessioni |
|
||||||
|
| nmap | 7.9x+ | Port scanning avanzato | Verifica isolamento reti, security group simulation |
|
||||||
|
|
||||||
|
## Development Tools
|
||||||
|
|
||||||
|
| Tool | Purpose | Notes |
|
||||||
|
|------|---------|-------|
|
||||||
|
| docker-compose config | Validazione YAML | Esegue check sintassi espandendo variabili |
|
||||||
|
| docker network inspect | Debug reti | Mostra container connessi, IP allocation |
|
||||||
|
| docker stats | Monitor risorse | Verifica limiti CPU/memoria in tempo reale |
|
||||||
|
| iptables -L -n -v | Debug firewall | Mostra regole NAT/forward attive |
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Core (Docker Engine + Compose V2 su Debian/Ubuntu)
|
||||||
|
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||||
|
sudo sh get-docker.sh
|
||||||
|
|
||||||
|
# Verifica versioni
|
||||||
|
docker --version # Docker Engine 28.0+
|
||||||
|
docker compose version # V2.36.2+
|
||||||
|
|
||||||
|
# Utility di rete (Debian/Ubuntu)
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y netcat-openbsd curl nmap iproute2
|
||||||
|
|
||||||
|
# PostgreSQL client (per connessioni da host)
|
||||||
|
sudo apt-get install -y postgresql-client
|
||||||
|
|
||||||
|
# MinIO client (mc) - opzionale ma consigliato per lab S3
|
||||||
|
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
|
||||||
|
--create-dirs -o $HOME/minio-binaries/mc
|
||||||
|
chmod +x $HOME/minio-binaries/mc
|
||||||
|
export PATH=$PATH:$HOME/minio-binaries
|
||||||
|
```
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
| Category | Recommended | Alternative | Why Not |
|
||||||
|
|----------|-------------|-------------|---------|
|
||||||
|
| Container orchestration | Docker Compose V2 | Kubernetes | Eccessiva complessità per lab locale, setup oneroso |
|
||||||
|
| Object storage | MinIO | LocalStack | LocalStack simula TUTTO AWS ma pesante, lento, richiede Java |
|
||||||
|
| Database | PostgreSQL | MongoDB | NoSQL non standard per lab base, SQL più didattico |
|
||||||
|
| Network isolation | Docker Bridge | Docker Overlay | Overlay per swarm multi-host, non necessario in locale |
|
||||||
|
| Compose syntax | YAML | HCL/Terraform | YAML standard Docker, HCL richiede apprendimento extra |
|
||||||
|
|
||||||
|
## What NOT to Use
|
||||||
|
|
||||||
|
| Avoid | Why | Use Instead |
|
||||||
|
|-------|-----|-------------|
|
||||||
|
| **Container come root** | Violazione principio minimo privilegio, rischio sicurezza critico | Dockerfile con `USER` oppure `user:` direttiva in compose |
|
||||||
|
| **Docker Compose V1** | Deprecato, non supportato, sintassi diversa | Compose V2 (`docker compose` senza trattino) |
|
||||||
|
| **Network mode "host"** | Bypassa isolamento, inutile per simulazione VPC | Bridge networks isolate |
|
||||||
|
| **Bind mount per persistenza** | Permessi file problematici tra host/container | Named volumes gestiti da Docker |
|
||||||
|
| **Ubuntu/Debian base images** | Inutilmente pesanti per semplici container | Alpine o distroless dove possibile |
|
||||||
|
| **Esposizione porte 0.0.0.0** | Espone servizi su tutte le interfacce, simula cattive pratiche | 127.0.0.1 o nessuna esposizione (solo rete interna) |
|
||||||
|
| **Limiti risorse indefinite** | Container può consumare tutto l'host, OOM kill incrociati | Sempre impostare `cpus` e `mem_limit` |
|
||||||
|
|
||||||
|
## Stack Patterns by Variant
|
||||||
|
|
||||||
|
**Seleziona variante database:**
|
||||||
|
|
||||||
|
**Se focus su MySQL/RDS MySQL:**
|
||||||
|
- Usa mysql:9.x image
|
||||||
|
- Variabili: `MYSQL_ROOT_PASSWORD`, `MYSQL_DATABASE`
|
||||||
|
- Because: Allievi che lavorano con MySQL in produzione
|
||||||
|
|
||||||
|
**Se focus su PostgreSQL/RDS/Aurora:**
|
||||||
|
- Usa postgres:18-alpine image
|
||||||
|
- Variabili: `POSTGRES_PASSWORD`, `POSTGRES_DB`
|
||||||
|
- Because: PostgreSQL più standard in cloud moderni
|
||||||
|
|
||||||
|
**Seleziona modalità esecuzione Docker:**
|
||||||
|
|
||||||
|
**Se lab su macchina personale:**
|
||||||
|
- Usa Docker rootless (installazione utente senza sudo)
|
||||||
|
- Because: Sicurezza migliore, simula environment cloud managed
|
||||||
|
|
||||||
|
**Se lab su VM fornita da scuola:**
|
||||||
|
- Docker standard (daemon service) accettabile
|
||||||
|
- Because: VM dedicata per singolo studente, isolation già garantito
|
||||||
|
|
||||||
|
## Version Compatibility
|
||||||
|
|
||||||
|
| Package A | Compatible With | Notes |
|
||||||
|
|-----------|-----------------|-------|
|
||||||
|
| Docker Engine 28.x | Compose V2 2.30+ | Compose V2 integrato in Engine CLI |
|
||||||
|
| Docker Engine 28.x | MinIO RELEASE.2025+ | Nessuna dipendenza diretta |
|
||||||
|
| Docker Engine 28.x | PostgreSQL 18.x | Funziona con qualsiasi DB che supporta container |
|
||||||
|
| PostgreSQL 18.x | pg_isready | Incluso in client package, sempre compatibile |
|
||||||
|
| MinIO RELEASE.2025+ | AWS S3 SDK v2/v3 | Compatibilità API 100% verificata |
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
- **Docker Engine v28 Release Notes** — https://docs.docker.com/engine/release-notes/28.0/ (HIGH confidence, verified 2025-05-30)
|
||||||
|
- **Docker Compose Documentation** — https://docs.docker.com/compose/ (HIGH confidence, official docs)
|
||||||
|
- **Docker Bridge Networks** — https://docs.docker.com/network/bridge/ (HIGH confidence, official docs)
|
||||||
|
- **MinIO Linux Documentation** — https://min.io/docs/minio/linux/index.html (HIGH confidence, version RELEASE.2025-05-24T17-08-30Z verified)
|
||||||
|
- **PostgreSQL Documentation** — https://www.postgresql.org/docs/ (HIGH confidence, version 18 confirmed current)
|
||||||
|
- **Docker Rootless Mode** — https://docs.docker.com/engine/security/rootless/ (HIGH confidence, security best practice)
|
||||||
|
- **Compose Build Specification** — https://docs.docker.com/compose/file-spec/build/ (HIGH confidence, V2 syntax verified)
|
||||||
|
|
||||||
|
---
|
||||||
|
*Stack research for: Cloud Training Laboratories (Laboratori Cloud)*
|
||||||
|
*Researched: 2026-03-24*
|
||||||
206
.planning/research/SUMMARY.md
Normal file
206
.planning/research/SUMMARY.md
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
# Project Research Summary
|
||||||
|
|
||||||
|
**Project:** Laboratori Cloud - Corso Soluzioni Cloud
|
||||||
|
**Domain:** Educational platform for cloud with practical Docker-based labs
|
||||||
|
**Researched:** 2026-03-24
|
||||||
|
**Confidence:** HIGH
|
||||||
|
|
||||||
|
## Executive Summary
|
||||||
|
|
||||||
|
This is an educational platform for teaching cloud concepts through local Docker-based laboratories, eliminating cloud costs while maintaining professional-grade learning outcomes. Expert-built cloud education platforms use sandbox environments with clear service mappings, explicit troubleshooting guidance, and structured skill progression. The recommended approach combines Docker's container isolation with a rigorous pedagogical framework (Diátaxis) and test-driven infrastructure methodology.
|
||||||
|
|
||||||
|
The research indicates that successful cloud labs require: (1) zero-cost local environments using Docker to simulate AWS services, (2) explicit Docker-to-cloud service mappings (Docker Networks → VPC, MinIO → S3, PostgreSQL → RDS), (3) comprehensive documentation following the Diátaxis framework (Tutorial, How-to, Reference, Explanation) for every lab, and (4) test-driven infrastructure where students write validation scripts before implementing solutions. The key differentiator is the "safety-first" approach that teaches security best practices as core habits rather than afterthoughts.
|
||||||
|
|
||||||
|
Critical risks include data loss from improper volume configuration, OOM killer crashes from missing resource limits, and security vulnerabilities from running containers as root. These are mitigated through mandatory named volumes, enforced CPU/memory limits, and non-root user directives in all lab configurations. The most significant pedagogical risk is students failing to understand the cloud parallels, which is addressed through explicit Explanation documents mapping every Docker component to its AWS equivalent.
|
||||||
|
|
||||||
|
## Key Findings
|
||||||
|
|
||||||
|
### Recommended Stack
|
||||||
|
|
||||||
|
**Core technologies:**
|
||||||
|
- Docker Engine 28.0+ and Docker Compose V2.36.2+ — Container orchestration foundation, standard market choice with native isolation and rootless support
|
||||||
|
- PostgreSQL 18.x or MySQL 9.x — Relational database simulating RDS/Aurora with ACID compliance
|
||||||
|
- MinIO RELEASE.2025+ — S3-compatible object storage with 100% API compatibility for local simulation
|
||||||
|
- Docker Bridge Networks + iptables — Network isolation simulating VPC/Subnets with NAT and firewall rules
|
||||||
|
|
||||||
|
**Critical stack decisions:**
|
||||||
|
- Avoid Docker Compose V1 (deprecated) — use V2 integrated syntax
|
||||||
|
- Always use named volumes (not bind mounts) for data persistence
|
||||||
|
- Enforce resource limits via `deploy.resources.limits` in all services
|
||||||
|
- Use non-root users via `user:` directive or Dockerfile USER command
|
||||||
|
|
||||||
|
### Expected Features
|
||||||
|
|
||||||
|
**Must have (table stakes):**
|
||||||
|
- Step-by-step instructions with exact commands — students need unambiguous guidance
|
||||||
|
- Working test environment — Docker Compose must start without errors
|
||||||
|
- Work verification via test scripts — automated validation (curl, nc, docker ps)
|
||||||
|
- Explicit cloud ↔ local parallels — every Docker concept maps to AWS service
|
||||||
|
- Basic troubleshooting guides — common errors and solutions
|
||||||
|
- Clear prerequisites — Docker versions, OS requirements, minimum resources
|
||||||
|
- Environment restoration — reset/cleanup commands for each lab
|
||||||
|
- Estimated completion time — 1-3 hours per lab typical
|
||||||
|
|
||||||
|
**Should have (competitive differentiators):**
|
||||||
|
- ZERO cloud costs — only local Docker, no AWS/Azure accounts
|
||||||
|
- Safety-first excellence — least privilege, network isolation, resource limits taught as core habits
|
||||||
|
- Complete Diátaxis framework — Tutorial + How-to + Reference + Explanation for EVERY lab
|
||||||
|
- Test-Driven Infrastructure (TDI) — RED→GREEN→REFACTOR methodology for infrastructure
|
||||||
|
- Designed incrementality — Labs 1-5 build progressively to complete system
|
||||||
|
- "Little often" approach — small concepts, frequent practice to avoid overwhelm
|
||||||
|
- Explicit Double Check — pre-commit checklists for each laboratory
|
||||||
|
- 1:1 architecture mapping — Docker Networks → VPC, MinIO → S3, PostgreSQL → RDS
|
||||||
|
- Included test scripts — students learn to validate their own work
|
||||||
|
- Professional Git workflow — Conventional Commits, per-lab branches
|
||||||
|
|
||||||
|
**Defer (v2+):**
|
||||||
|
- Official solutions — add after student requests for self-verification
|
||||||
|
- Auto-correction scripts — helpful but not essential for learning
|
||||||
|
- Optional challenge labs — for advanced students who find core too easy
|
||||||
|
- Multi-cloud versions — AWS focus first, Azure/GCP parallels later
|
||||||
|
- Pre-configured VM — only if setup issues become widespread
|
||||||
|
|
||||||
|
### Architecture Approach
|
||||||
|
|
||||||
|
**Major components:**
|
||||||
|
1. Docker Engine — Container lifecycle, image management, network isolation
|
||||||
|
2. Docker Compose — Multi-container orchestration per lab, service dependencies
|
||||||
|
3. Bridge Networks — VPC/Subnet simulation with network isolation and DNS resolution
|
||||||
|
4. Named Volumes — Persistent data storage (DB, Object Storage) with data isolation
|
||||||
|
5. Test Containers — Network connectivity verification and service health checks
|
||||||
|
6. Student Workspace — Git repo, lab documentation, test scripts
|
||||||
|
|
||||||
|
**Key architectural patterns:**
|
||||||
|
- Network isolation via multiple bridge networks simulating VPC public/private subnets
|
||||||
|
- Resource limits enforcing CPU/memory quotas matching cloud instance sizes
|
||||||
|
- Healthcheck directives ensuring service readiness before dependencies start
|
||||||
|
- Volume initialization with seed data for database labs
|
||||||
|
- Test container pattern for isolation and connectivity verification
|
||||||
|
|
||||||
|
**Critical anti-patterns to avoid:**
|
||||||
|
- Default bridge network (no isolation, poor DNS)
|
||||||
|
- Running as root (security vulnerability, violates cloud best practices)
|
||||||
|
- Exposing all ports to host (port conflicts, security exposure)
|
||||||
|
- Anonymous volumes (difficult management, can't backup easily)
|
||||||
|
- No resource limits (unrealistic behavior, no quota simulation)
|
||||||
|
|
||||||
|
### Critical Pitfalls
|
||||||
|
|
||||||
|
1. **Data loss on container restart** — Always use named Docker volumes with explicit declarations in top-level `volumes:` section; teach volume lifecycle and persistence early
|
||||||
|
|
||||||
|
2. **Networking confusion (localhost vs container names)** — Teach Docker's internal DNS resolution first; always use service names for inter-container communication; create network diagrams showing container isolation
|
||||||
|
|
||||||
|
3. **OOM killer (resource exhaustion)** — Always set `mem_limit` and CPU limits in docker-compose; monitor with `docker stats`; recommend 16GB RAM minimum for host
|
||||||
|
|
||||||
|
4. **Running as root** — Always specify `user:` directive in docker-compose or Dockerfile; teach Linux permission basics alongside Docker; never use `--privileged` flag
|
||||||
|
|
||||||
|
5. **Port conflicts and binding issues** — Use non-standard ports in examples (5433 instead of 5432); teach students to check port usage; document all port mappings; provide conflict detection scripts
|
||||||
|
|
||||||
|
6. **depends_on without readiness checks** — Implement healthchecks for all services; use restart policies with delays; teach difference between "running" and "healthy"
|
||||||
|
|
||||||
|
7. **Orphaned resources (disk space exhaustion)** — Teach cleanup commands in every lab; provide cleanup scripts; use `--rm` flag for one-off containers; explain volume lifecycle
|
||||||
|
|
||||||
|
## Implications for Roadmap
|
||||||
|
|
||||||
|
Based on research, suggested phase structure:
|
||||||
|
|
||||||
|
### Phase 1: Lab 01 - IAM & Security
|
||||||
|
**Rationale:** Foundation for all subsequent labs; introduces Docker basics, Linux permissions, volume concepts, and security-first mindset that prevents critical pitfalls #1, #3, #4
|
||||||
|
**Delivers:** Docker environment setup, user permissions basics, named volume introduction, cleanup procedures
|
||||||
|
**Addresses:** Table stakes (step-by-step instructions, working environment, troubleshooting, prerequisites)
|
||||||
|
**Avoids:** Data loss on restart, running as root, orphaned resources, permission errors
|
||||||
|
**Features:** Framework Diátaxis (4 docs), test scripts with TDI methodology, Git workflow, cloud parallels (Linux users → IAM Users)
|
||||||
|
|
||||||
|
### Phase 2: Lab 02 - Network
|
||||||
|
**Rationale:** Core cloud concept (VPC) and critical prerequisite for Labs 3-5; addresses networking confusion (pitfall #2) and port conflicts (pitfall #5)
|
||||||
|
**Delivers:** Docker bridge networks, VPC/subnet simulation, DNS resolution, network isolation, port mapping
|
||||||
|
**Uses:** Docker Bridge Networks, iptables for NAT/firewall simulation
|
||||||
|
**Implements:** Network isolation pattern, test container pattern for connectivity verification
|
||||||
|
**Avoids:** Networking confusion, port conflicts, default bridge network anti-pattern
|
||||||
|
**Features:** Network diagrams, isolation verification tests, routing table explanations
|
||||||
|
|
||||||
|
### Phase 3: Lab 03 - Compute
|
||||||
|
**Rationale:** Simulates EC2/VM with resource limits; introduces healthchecks preventing pitfall #6; builds on Lab 2 networking
|
||||||
|
**Delivers:** Containers with CPU/memory limits, healthcheck implementation, service dependencies
|
||||||
|
**Uses:** Resource limits pattern, healthcheck pattern
|
||||||
|
**Implements:** Compute quota simulation, service readiness verification
|
||||||
|
**Avoids:** OOM killer, depends_on without readiness checks, no resource limits
|
||||||
|
**Features:** Resource monitoring with docker stats, healthcheck test scripts
|
||||||
|
|
||||||
|
### Phase 4: Lab 04 - Storage
|
||||||
|
**Rationale:** Simulates S3 (MinIO) + Block Storage (Volumes); volume persistence is critical (pitfall #1); independent from Lab 3 but depends on Lab 2 networking
|
||||||
|
**Delivers:** MinIO S3-compatible storage, named volume management, volume initialization with seed data
|
||||||
|
**Uses:** Docker Volumes, MinIO for S3 simulation
|
||||||
|
**Implements:** Volume initialization pattern, object storage access patterns
|
||||||
|
**Avoids:** Data loss from missing volumes, anonymous volumes, tmpfs for persistent data
|
||||||
|
**Features:** S3 API compatibility demonstration, volume persistence verification tests
|
||||||
|
|
||||||
|
### Phase 5: Lab 05 - Database
|
||||||
|
**Rationale:** Culmination integrating all concepts (Network + Storage + Compute); simulates RDS in private network; demonstrates multi-tier architecture
|
||||||
|
**Delivers:** PostgreSQL/MySQL in isolated network, application-to-database connections, cross-network communication, data persistence
|
||||||
|
**Uses:** PostgreSQL/MySQL, named volumes, private networks from Lab 2
|
||||||
|
**Implements:** Multi-tier architecture, complete VPC simulation with public/private subnets
|
||||||
|
**Avoids:** Networking confusion, depends_on without readiness, data loss
|
||||||
|
**Features:** Complete cloud architecture (VPC + RDS + S3), comprehensive integration tests
|
||||||
|
|
||||||
|
### Phase Ordering Rationale
|
||||||
|
|
||||||
|
- **Lab 1 first** because it establishes foundational security practices and Docker basics that all subsequent labs depend on; skipping this would cause permission errors and security issues throughout
|
||||||
|
- **Lab 2 before Labs 3-5** because network isolation is a prerequisite for realistic compute, storage, and database simulation; cloud services depend on VPC networking
|
||||||
|
- **Lab 3 before Lab 5** because compute patterns (healthchecks, resource limits) are needed for database-dependent applications
|
||||||
|
- **Lab 4 before Lab 5** because storage persistence concepts are needed for database data persistence
|
||||||
|
- **Lab 5 last** because it integrates all previous concepts (Network + Compute + Storage) into a complete multi-tier cloud architecture
|
||||||
|
|
||||||
|
### Research Flags
|
||||||
|
|
||||||
|
**Phases likely needing deeper research during planning:**
|
||||||
|
- **Phase 2 (Network):** Complex iptables rules for NAT Gateway simulation may require targeted research during implementation
|
||||||
|
- **Phase 5 (Database):** Database initialization timing and cross-network connection pooling may need validation research
|
||||||
|
|
||||||
|
**Phases with standard patterns (skip research-phase):**
|
||||||
|
- **Phase 1 (IAM):** Well-documented Docker security patterns, standard Linux permission practices
|
||||||
|
- **Phase 3 (Compute):** Established resource limit patterns in Docker Compose, standard healthcheck implementations
|
||||||
|
- **Phase 4 (Storage):** MinIO documentation is comprehensive, Docker volume patterns are standard
|
||||||
|
|
||||||
|
## Confidence Assessment
|
||||||
|
|
||||||
|
| Area | Confidence | Notes |
|
||||||
|
|------|------------|-------|
|
||||||
|
| Stack | HIGH | All technologies verified against official documentation (Docker Engine v28, Compose V2, PostgreSQL 18, MinIO RELEASE.2025) |
|
||||||
|
| Features | MEDIUM | Based on competitor analysis and educational best practices; some assumptions about student needs validated through industry patterns |
|
||||||
|
| Architecture | HIGH | Docker networking, storage, and orchestration patterns well-documented; architectural decisions backed by official sources |
|
||||||
|
| Pitfalls | HIGH | All pitfalls verified against official Docker documentation and common educational patterns in container-based training |
|
||||||
|
|
||||||
|
**Overall confidence:** HIGH
|
||||||
|
|
||||||
|
### Gaps to Address
|
||||||
|
|
||||||
|
- **Student feedback data:** No access to real student feedback on cloud lab effectiveness; will need to validate through beta testing
|
||||||
|
- **Multi-cloud parallels:** Research focused on AWS; Azure/GCP parallels not deeply researched but can be added in v2 as requested
|
||||||
|
- **Learning effectiveness measurement:** No academic studies available on Docker-based vs cloud-based learning outcomes; assumes equivalence based on service mapping
|
||||||
|
- **VM pre-configurata specifics:** Not researched in detail; can address if student setup issues become widespread (deferred to v1.x)
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
### Primary (HIGH confidence)
|
||||||
|
- Docker Engine v28 Release Notes — https://docs.docker.com/engine/release-notes/28.0/
|
||||||
|
- Docker Compose Documentation — https://docs.docker.com/compose/
|
||||||
|
- Docker Bridge Networks — https://docs.docker.com/network/bridge/
|
||||||
|
- Docker Storage Documentation — https://docs.docker.com/storage/volumes/
|
||||||
|
- MinIO Linux Documentation — https://min.io/docs/minio/linux/index.html
|
||||||
|
- PostgreSQL Documentation — https://www.postgresql.org/docs/
|
||||||
|
- Docker Rootless Mode — https://docs.docker.com/engine/security/rootless/
|
||||||
|
- Docker Security Documentation — https://docs.docker.com/engine/security/
|
||||||
|
|
||||||
|
### Secondary (MEDIUM confidence)
|
||||||
|
- AWS Skill Builder, Azure Lab Services, KodeKloud, A Cloud Guru — Competitor feature analysis
|
||||||
|
- Educational best practices in cloud training platforms
|
||||||
|
- Container-based training course patterns
|
||||||
|
- Cloud lab environment design patterns
|
||||||
|
|
||||||
|
### Tertiary (LOW confidence)
|
||||||
|
- None used — all findings based on HIGH or MEDIUM confidence sources
|
||||||
|
|
||||||
|
---
|
||||||
|
*Research completed: 2026-03-24*
|
||||||
|
*Ready for roadmap: yes*
|
||||||
Reference in New Issue
Block a user