Images and Layers
Explore the contents of Docker images and their layers.
We'll cover the following...
As already mentioned, Docker images are a collection of loosely connected read-only layers where each layer comprises one or more files. The figure below shows an image with four layers. Docker takes care of stacking them and representing them as a single unified image.
Press + to interact
Inspecting layers
Let’s look at all of the following ways to inspect layer information:
- Pull operations
- The
docker inspect
command - The
docker history
command
Run the following command to pull the node:latest
image and observe it pulling the individual layers. Some newer versions may have more or less layers, but the principle is the same.
$ docker pull node:latestlatest: Pulling from library/ubuntu952132ac251a: Pull complete82659f8f1b76: Pull completec19118ca682d: Pull complete8296858250fe: Pull complete24e0251a0e2c: Pull completeDigest: sha256:f4691c96e6bbaa99d...28ae95a60369c506dd6e6f6abStatus: Downloaded newer image for node:latestdocker.io/node:latest
Pulling a Docker image
Each line ending with Pull complete
represents a layer that Docker pulled. This ...