Inspect Docker layer

In this post , I will share one of the ways showing how to know what is the size of the image plus the layer of the image

To do that follow the steps

  • Create Linux variable one for the layer the other one for the size with the following
export showLayers='{{ range .RootFS.Layers }}{{ println . }}{{end}}'

export showSize='{{ .Size }}'

  • Check The size like the below
docker inspect -f "$showSize" <Container-name:tag>

  • Check the Layer like the below
docker inspect -f "$showLayers" <Container-name>

Regards

Osama