Docker Community Forums

Share and learn in the Docker community.

Do number of layers (in an image) affect the runtime performance?


(Lavjain) #1

Minimizing the number of layers definitely helps with pulling the repo from docker hub. However, once the image has been downloaded, do the number of layers affect the runtime performance of the container?


(Think) #2

depends on your operations. if they are file system intensive, then probably yes.

if you encounter any problems, there are also several strategies to solve:

  • shrink all layers into a single one.
  • minimize your image
  • attaching a volume