Images vs Containers
An image is an immutable template — the recipe. A container is a live instance running from that image, with its own writable layer. In this lesson we see how one image runs many independent containers, and why removing a container does not remove the image.
An image is a recipe in a cookbook, and a container is a dish you already cooked from it. From the same recipe you can cook many plates, and each plate is separate — if you eat one, the recipe is still in the book.
- image
- A read-only, immutable template packaging code, dependencies, and configuration, from which containers are run. The image itself does not run and does not change.
- container
- A live, running instance of an image. Each container is isolated, has its own name and its own writable layer, and one image can run many of them at once.
- writable layer
- A thin read-write layer each container gets on top of the read-only image. Runtime changes are stored here, and it is deleted when the container is removed.