Looking at the history of an image
It is imperative for us to have a deeper understanding of the Docker image we are using. The docker image history
command helps us find all the layers in the image, its image ID, when it was created, how it was created, the size, and any additional comments associated with that layer.
Getting ready
Before we begin the next recipe, first pull or import any Docker image.
How to do it...
To look at the history of the image, consider the following syntax:
$ docker image history [OPTIONS] IMAGE
Here's an example using the preceding syntax:
$ docker image history myapache2

How it works...
When we build a Docker image, the Docker engine preserves the build instruction in the image metadata. Later, the docker image history
command recursively gathers these build instruction from the prescribed image to the base image and presents it in a nice format.
There's more...
If you recall the Creating an image from the container recipe, while committing the image we added a message...