For many developers, using the “Official” Docker image on Docker Hub suits their needs perfectly well. Images on Docker Hub are verified and checked against known security vulnerabilities and the software vendor is verified by Docker. All of which leads to hundreds of thousands of “Official” images that users can browse and use in their projects. By using an Official image, developer workflows are easier, tools can be reused, and code can be deployed faster and with less effort.

However, there are a number of benefits to coming up with your own containers, even if it isn’t the usual route for most developer teams.

  • Gives you complete control over all the software that is included in your container. You can set an exact set of dependencies and configurations that your application developers, compliance, and infosec teams need, which can minimize the risk of vulnerabilities introduced by external dependencies; reduce the potential attack surface; and help your organization ensure compliance with security, regulatory, or privacy standards.

  • Can lead to significant performance improvements. Building your own container allows you to eliminate services that run inside the container and remove resources that your application doesn’t need, both of which can be important in resource-constrained devices, such as embedded systems. It can also reduce the size of the running container, reducing the cost of running the application and improving the application’s startup times. Small optimizations like these can lead to significant performance improvements, especially when running containers at scale.

  • Allows you to learn deeply. The process of building containers from scratch is often a valuable learning experience. It’s a practical way to learn how all the different components of your application and operating system work together. Also, it can solidify your knowledge around system administration, package administration, security, infrastructure engineering, and core operating system fundamentals.

The knowledge, skills, and abilities gained from building custom containers are invaluable for troubleshooting, debugging, and contributing to container-related projects, particularly if you are migrating legacy applications to containerized-workloads. In addition, the process provides insight into how micro-services are designed and organized in ways that make sense when running on cloud-based infrastructure, which will help you architect services in the future.