docker image history

Shows the layers of an image, newest first, with the instruction that created each one and its size.

In more detail

Instructions that only set metadata, such as CMD, show a size of 0 B. History helps you find which step made an image large, but it is not a security audit: a file deleted in a later layer still exists in an earlier one.

Example

docker image history layers:demo

Related terms

Taught in

References