CLASSROOM // HOMELAB ACADEMY M15 LESSON
M15 LESSONlesson

Homelab Academy / Modules

Teach it back 01-docker-networking: Lesson

Orient, prior check, guided practice, required Feynman, reflect.

Show commands for:

Overview

Module: Compose Operations & IaC
Activity type: Lesson (Orient → Recall → Learn → Explain → Reflect)
Learning objective: Explain the difference between a container port and a host-published port
Bloom level: Understand / Apply
Last reviewed: 2025-03-08

Objective

Learning objective

Explain the difference between a container port and a host-published port

Why it matters

Why this matters

Teach how Docker Compose creates isolated bridge networks, provides service-name DNS, connects multi-homed services, and controls host exposure through explicit port publishing.

Learn

Learn

Complete the module reading first:

Teach it back

Feynman teach-back: required

prompt

Explain the lab to someone who knows basic networking but has never used Docker.

model_explanation

Each container is like a small machine with one or more virtual network cards. The frontend network connects the client to the gateway, and the backend network connects the gateway to the database. Docker supplies a private directory service so containers on a shared network can use names such as gateway and database instead of changing IP addresses. The client cannot directly find or contact database because they do not share a network. The gateway has a virtual connection to both networks, so it can talk to each side. Port 8080 is open inside the gateway container, but it is not mapped to a port on the physical host. Therefore, other containers on frontend can use it, while host users do not receive a Docker-published endpoint.

Answers save in this browser (localStorage). Completing all five fields is part of the mastery unlock.

Reflect

Reflection

  1. What did I learn?
  2. What did I struggle with?
  3. How does this connect to earlier classes?
Learn

Topic path (do in order)

Step Activity Purpose
1 Reading Learn
2 This lesson (Feynman) Explain
3 Lab Practice
4 Homework Apply
5 Quiz Test
← ReadingLab →