JVM plus Docker: Better together

JVM-Docker combination yields new options for Java application packaging and deployment

Docker, the high-profile project for packaging applications in portable containers, can be paired with the JVM (Java virtual machine) to fill in gaps in the Java realm, technologists say.

The JVM is Java's solution for application portability across different platforms, but Docker can offer an effective complement, stressed Al Tobey, open source mechanic at Datastax. "It provides a bunch of stuff that the JVM doesn't do," Tobey said following his presentation on Docker at a Silicon Valley Java User Group meeting this week. "The JVM has really good sandboxing. It's very well-respected, it has pretty good memory control. What it doesn't have is really sophisticated CPU resource control, and so Docker brings that to the table. It also brings the packaging of the entire JVM with the JARs and all the different parts of the app into one container."

These can be shipped around byte for byte, Tobey said. He also noted that the JVM-Docker combination is catching on: "I talk with a lot of the devops folks, the leaders in the field, and a lot of them are deploying Java apps on Docker."

For Java users, Docker provides configuration benefits and should make it easier to deploy Java applications, said Arun Gupta, a co-leader of the user group and director of developer advocacy at Red Hat. A Docker image featuring the JVM along with details on tuning, configuration, and threads can be downloaded. "All of that could be bundled the Docker way," said Gupta, who previously worked on Java efforts at Sun Microsystems and Oracle. 

In deploying JVM applications, developers would probably want a separate Docker file that builds an image that has the JVM in it, Tobey said during his presentation. The file would then be saved to a Docker repository, whereupon application virtual machines would be built directly, so the Java Development Kit does not have to be installed on every single build. "That's pretty easy to do," Tobey pointed out. "In fact, I do that here a lot." 

With Docker, applications are portable and can run anywhere, including OS X and Windows machines, cloud servers running Ubuntu Linux, and data center virtual machines running Red Hat. The technology has received support from such major players as Google, as well as Red Hat, Microsoft, and IBM.

This story, "JVM plus Docker: Better together" was originally published by InfoWorld.

Join the discussion
Be the first to comment on this article. Our Commenting Policies