Google Launches Jib, Automated Container Packaging for Java Apps
Google has released software that could automate the packaging of a Java program so that it can be run in the cloud-native environment.
Jib is an open-source Java “containerizer,” one that handles all the steps of packaging your application into a container image, according to Appu Goundan and Qingyang Chen, two Google engineers who co-wrote a blog post announcing the new technology.
Created over two decades ago at Sun Microsystems, Java was introduced as a “write once, run anywhere” programming language, where all the code would be packaged in a JAR file, and run by a Java Virtual Machine on any platform. The requirements for running code anywhere have expanded with the introduction of containerization, however. Few shops are Java-only these days, and many are turning to containerization for true application portability,
And this requires more work. If you want to run a Java program in a container, you have to “write a Dockerfile, run a Docker daemon as root, wait for builds to complete, and finally push the image to a remote registry,” the engineers point out.
With Jib, the developer wouldn’t need to write a Dockerfile or even have Docker installed. Instead, Jib is a plug-in that can be integrated with either the Apache Maven or with the Gradle open source automated build software.
These tools are used to create the container image, and the JAR file is created with the code and all its dependencies (a “fat JAR”). “Since Jib tightly integrates with your Java build, it has access to all the necessary information to package your application. Any variations in your Java build are automatically picked up during subsequent container builds,” the engineers write.
This approach can save time, especially when updates need to be made. Jib reads the configuration file for the build, builds the application in distinct layers (dependencies, resources, classes), so it can be quickly rebuilt using only the updated components.
Google was not alone this week in making the containerization case to enterprise Java developers. In a blog post, Red Hat Director of Developer Experience Rafael Benevides argued that the Kubernetes container orchestration engine, first developed by Google, can be thought of as occupying a similar role as Java application servers have of the past decade. But they also have additional benefits. “One of the best things about moving to containers, Kubernetes, and microservices is that you don’t have to choose a single application server, framework, architectural style or even language for your application,” he argued.
Google and Red Hat are sponsors of The New Stack.
Feature art via Pixabay.