Running Java in a Container

What are the pitfalls of running Java or JVM-based applications in containers? In this article, Jörg Schad and Ken Sipe discuss the challenges and solutions.

The Java Virtual Machine (not even with the Java 9 release) is not fully aware of the isolation mechanisms that containers are built around. This can lead to unexpected behavior between different environments (e.g., test vs production). To avoid this behavior one should consider overriding some default parameters (which are usually set by the memory and processors available on the node) to match the container limits.

Apache Mesos and DC/OS are both platforms that enable users to run their applications (or a large number of data services such as Apache Spark, Flink, Kafka, and many more) in containers.

One question that we’ve been hearing a lot recently is “how can I run my Java applications in containers?”

Read more at Mesosphere Blog