Chapter 6: Docker Images and Containers
6.2 Image vs container vs layers
| Word | Meaning | Real-world picture |
|---|---|---|
| Image | Read-only template (layers of files + metadata) | Sealed runnable template |
| Container | Running (or stopped) instance of an image | One running process from that template |
| Layer | A filesystem diff from a Dockerfile step | One prep step frozen in the kit |
| Registry | Place that stores images (Docker Hub, GHCR…) | Central store room |
Dockerfile --build--> Image --run--> Container
^
|
pull from registry (optional)
Many containers can run from one image. Deleting a container does not delete the image unless you remove the image too.
docker version
docker info
What you see: client/server version info if Docker is installed and the daemon is running. Install Docker Desktop (laptop) or follow an Amazon Linux Docker install guide on your practice EC2 when needed — use a maintained guide on this site or Docker's docs; we will not invent package quirks here.
Practice task
In your own words: image vs container (two sentences). Say which one you build and which one you run.