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

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?

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