
How To Show All Layers Of A Docker Image
1
Use the docker history command
As an example, we’ll check out the layers of the python:3.6 image. So first run:
docker pull python:3.6And use docker history to show the layers.
docker history python:3.62
Analyze the output
The output of this command will show you details about how each layer was created and the size:
IMAGE CREATED CREATED BY SIZE COMMENT
a5b7afcfdcc8 2 months ago /bin/sh -c #(nop) CMD ["python3"] 0B
2 months ago /bin/sh -c set -ex; wget -O get-pip.py 'ht… 6MB
2 months ago /bin/sh -c #(nop) ENV PYTHON_PIP_VERSION=10… 0B
2 months ago /bin/sh -c cd /usr/local/bin && ln -s idle3… 32B
2 months ago /bin/sh -c set -ex && buildDeps=' dpkg-de… 67.3MB
2 months ago /bin/sh -c #(nop) ENV PYTHON_VERSION=3.6.5 0B
2 months ago /bin/sh -c #(nop) ENV GPG_KEY=0D96DF4D4110E… 0B
2 months ago /bin/sh -c apt-get update && apt-get install… 8.73MB
2 months ago /bin/sh -c #(nop) ENV LANG=C.UTF-8 0B
2 months ago /bin/sh -c #(nop) ENV PATH=/usr/local/bin:/… 0B
2 months ago /bin/sh -c set -ex; apt-get update; apt-ge… 556MB
2 months ago /bin/sh -c apt-get update && apt-get install… 142MB
2 months ago /bin/sh -c set -ex; if ! command -v gpg > /… 7.8MB
2 months ago /bin/sh -c apt-get update && apt-get install… 23.2MB
3 months ago /bin/sh -c #(nop) CMD ["bash"] 0B
3 months ago /bin/sh -c #(nop) ADD file:9572fdb59dfbb9b03… 101MB