Painfully learned container lessons
As you start building your own containers, you can avoid many problems by keeping in mind the best practices discussed in Docker’s official documentation here: https://docs.docker.com/get-started/09_image_best/.
That said, we’ve compiled a small list of the most egregious containerization mistakes we’ve noticed, and how to avoid them. This section is the result of many sleepless nights, outages, and learning things the hard way.
Image size
Start with minimal images, like Scratch or Alpine. To deploy most applications, it’s a good idea to try to stay away from big images and distributions like Ubuntu. When build dependencies are required, removing these, or using intermediate build containers when building larger/multi-container projects, is recommended.
Small, minimal images don’t just mean faster download speeds and less resource usage, but also make it a lot easier for you to manage. If an image...