17 Optimizing your Docker images for size, speed and security
Once you have your apps containerized and working well in a cluster you may think that you're good to go to production - but there are some best practices you still need to invest time in. Optimizing your Docker images is one of the most important, because you need your builds and deployments to be fast, your application content to be secure and you do not want to be paged at 2 a.m. when your servers have run out of disk space. The Dockerfile syntax is small and intuitive, but it hides some complexity which you need to understand to make the most of your image builds. This chapter will take you through the finer details of the image format so you know how and why to optimize it - we'll be building on chapter 3 where we learned that Docker images are actually merged from multiple image layers.