liveBook · Manning

Image layer

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

An image layer is an immutable filesystem change set that contributes to a container image and can be stacked with other layers.

An image layer is an immutable filesystem change set that contributes to a container image. Images stack layers: a base image supplies lower content, later layers add changes, and committing a container creates another layer. section 2.2.1

Podman stores layers through container/storage. A layered filesystem mounts each layer over the previous one, while a copy-on-write storage driver presents the assembled filesystem. Podman uses overlay by default; in Podman, this name refers to the newer overlay2 implementation. section 5.1.2

Image layers support several operational workflows:

  • Inspect image ancestry with podman image tree, which displays layer identifiers, sizes, and the images contributing each layer. section 2.2.1
  • Compare filesystem changes with podman image diff; entries are classified as changed (C), added (A), or deleted (D). section 2.2.1
  • Pull layers as registry blobs, then let containers/storage untar and reassemble them into overlay mounts in local storage. section 6.2.1

Inspecting a committed image

After committing a container to an image named myimage, run podman image tree myimage to view its stacked layers. Run podman image diff myimage ubi8/httpd-24 to identify configuration files and certificates added or changed above the lower image. section 2.2.1

$ podman image tree myimage
Image ID: 2c7e43d88038
Tags:   [localhost/myimage:latest]
Size:   461.7MB
Image Layers
├── ID: e39c3abf0df9 Size: 233.6MB
├── ID: 42c81bd2b468 Size: 20.48kB Top Layer of: [registry.access.redhat.com/ubi8:latest]
├── ID: 51a7beaa0b88 Size: 57.43MB
├── ID: 519e681b5702 Size: 170.6MB Top Layer of: [registry.access.redhat.com/ubi8/httpd-24:latest]
└── ID: bc3dcdefdac3 Size: 69.63kB Top Layer of: [localhost/myimage:latest localhost/myapp:latest]

Use the layer tree to inspect ancestry, sizes, and the top-layer relationship between ubi8, ubi8/httpd-24, and myimage. section 2.2.1

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains layer stacking, TAR diffs, overlay mounting, and blob extraction, while deferring detailed driver configuration.
Examples
Uses ubi8/httpd-24, myimage, podman image tree, podman image diff, and registry blob-pull output.
What it assumes
Assumes basic Podman container and image usage, then establishes layer storage and assembly mechanics.
What you can do after
Diagnose image composition and filesystem changes with podman image tree and podman image diff.
How it connects
Connects image layers to container images, container storage, layered filesystems, copy-on-write filesystems, storage drivers, and container registries.

Also explained in

Compare how 5 books explain image layer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.