The Shipping Container
Tap the board to zoom inClick the board to zoom in
Lessons that use this board
- The Shipping Container (Docker)lesson
- Container 03: A Mount Namespace and pivot_rootlesson
- Container 07: Everythinglesson
Lesson 1 -- The Shipping Container (Docker)
THE STORY -- 1956, on the docks:
barrels, sacks, odd crates -- all
different. loaded by hand. slow, broke.
the box
one standard steel box: any crane,
any ship, any truck. trade exploded.
DOCKER = that same box,
but for software (below)
THE PROBLEM -- "but it works on my machine!"
app
DEV laptop: has python3.9, libX, env
deploy ->
PROD server
libX missing -> crash
"...but it works
on my machine"
same app, different surroundings -> it breaks.
THE FIX -- seal it into one box
app + libs + runtime + config
IMAGE
laptop
server
cloud
each running box = a CONTAINER --
same contents on any host (same CPU family)
LAYERS -- why a rebuild is tiny & fast
base OS
python runtime
libraries
YOUR CODE
base OS
python runtime
libraries
YOUR CODE v2
container A
container B
top slab changed? only THAT one
rebuilds -- seconds, not minutes.
the lower slabs are identical, so they're
built & downloaded ONCE and shared by
both boxes. that's why images stay small.
JARGON, DECODED
image = sealed box on disk | container = image running | Dockerfile = the recipe to build it | registry (Docker Hub) = the box warehouse (push / pull)
You already live this: every shop service (users, core, payments) is a container -- that's why "more stalls when busy" (SD-01) just works.
Saved in this browser only.