Docker images vs containers
Quick answer
An image is the packaged starting point for a container. A container is an instance created from an image, with its own configuration and normally a writable filesystem layer. The same image can create multiple containers.
Two containers, one image
Suppose two learners start a web server from the same image. Each container has its own process lifecycle. Stopping one does not stop the other just because they share an image. Writing a file into one container’s writable layer does not rewrite the original image or the other container’s writable layer. An image is a read-only template from the container’s point of view. If the application writes note.txt without a mount, the new file belongs to that container, not to the shared template.
Where images come from
A registry stores and distributes images. A tag such as latest is a name that can move to a different image; it is not proof of freshness. A digest identifies specific content. For a reproducible lab, record the digest and platform. External volumes and shared mounts can deliberately share data between containers; they are not part of the isolated writable layer.
Try it yourself
Draw one image and two containers. Mark which component changes when one container writes a local file without a mount.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Docker images vs containers — knowledge check
Check understanding of the lesson concepts.
What does starting two containers from one image normally create?
Which identifier is suited to pinning specific image content?