Chapter 3. An Introduction to Containers

Any fool can know. The point is to understand.

Albert Einstein

If you know the why, you can live any how.

Friedrich Nietzsche

At the time of this writing, the use of containers in production and other environments is growing exponentially, and best practices around containerizing applications are still being discussed and defined. As we home in on efficiency improvements and consider specific use cases, techniques and patterns have evolved that come highly recommended by the blogosphere and professional practitioners through experience. And as expected, a fair share of patterns and common uses have evolved, as well as antipatterns that I hope this chapter will help you recognize and avoid.

My own trial-and-error introduction to containers felt like stirring up a hornet’s nest (oh, the stings!). I was undeniably unprepared. Containerization on the surface is deceptively simple. Knowing what I know now about how to develop and deploy with containers, especially within the Java ecosystem, I hope to pass this knowledge on in a way that will help prevent similar pain for you. This chapter outlines the essential concepts you will need to successfully containerize your applications and discusses why you would even want to do such a thing.

Chapter 4 discusses the bigger picture of microservices, but here we will start with learning about one of the basic building blocks of microservice deployments that you will no doubt encounter ...

Get DevOps Tools for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.