Lesson 1.1Free preview

Images, containers, and layers

An image is an immutable stack of filesystem layers plus metadata.

4mBeginner28.4k students

Overview

A template and a running instance

An image is an immutable stack of filesystem layers plus metadata. A container is one running instance of that image with a thin writable layer on top, which is why starting one is fast and why anything written inside it disappears when it is removed.

Each build instruction adds a layer, and layers are content-addressed. Ten images built from the same base share that base on disk and in transfers — only the differing layers move.

The writable layer is also why data belongs in a volume. Treating a container filesystem as storage works right up until the first restart.

In this lesson you will:

  • Tell an image apart from a container
  • Understand the copy-on-write layer stack
  • See why layers are shared between images

Resources

Next Lesson
Images, containers, and layers — Docker Essentials — Vertex