DOCKER · Learning guideTheory · Labs · Knowledge checks
Chapter 01

Containers, images and the Docker architecture

Why containers?

Containers package an application with its runtime dependencies while sharing the host operating-system kernel. They are lightweight compared with full virtual machines. Isolation is useful, but it is not the same security boundary as a VM.

docker version
docker info
Hands-on lab: Compare a virtual machine (guest OS) with a container (shared host kernel).
Quick check: Does an image equal a running container?
Show answer
No. An image is a template; a container is an instance.

The Docker architecture

The Docker CLI talks to the Docker Engine daemon. The engine manages images, containers, networks and volumes. Registries distribute images. Docker Desktop bundles a convenient local environment.

docker context ls
docker system info
Hands-on lab: Draw CLI → Engine → container and Engine ↔ registry.

Lifecycle and licensing

Typical lifecycle: pull/build → create → start → inspect/log → stop → remove. Docker Engine and Docker Desktop have distinct distribution and licensing terms; review the applicable terms before corporate deployment.

docker pull hello-world
docker run --rm hello-world
Hands-on lab: Explain why --rm removes the stopped container.