12 Running Java in containers

 

This chapter covers

  • Why container-driven development is important for the well-grounded Java developer
  • The difference between an OS, a VM, a container, and orchestration
  • Docker
  • Kubernetes
  • Practical guidance on running Java workloads in containers
  • Performance and observability in containers

Docker (https://www.docker.com/) containers have become the de facto standard for packaging Java applications for deployment, and Kubernetes (https://kubernetes.io/) (k8s) is the most popular option for orchestrating those containers. Especially if you are deploying to any of the major cloud providers, you will need to know about these technologies and, more importantly, how Java behaves with them.

Note

Although other container and container orchestration technologies exist, Docker and Kubernetes dominate the container and orchestration markets, respectively.

12.1 Why containers matter for a well-grounded developer

To better understand what containers are and why they are important for a well-grounded Java developer, we will look at the following:

  • Host operating system versus virtual machines versus containers
  • The benefits of containers
  • The drawbacks of containers

12.1.1 Host operating systems vs. virtual machines vs. containers

12.1.2 Benefits of containers

12.1.3 Drawbacks of containers

12.2 Docker fundamentals

12.2.1 Building Docker images

12.2.2 Running Docker containers

12.3 Developing Java applications with Docker

sitemap