Google officially open source Jib to help Java applications quickly containerize
Google this week announced the opening of a new Java tool, Jib, designed to make it easier for developers to container Java applications with tools they are familiar with.
In a blog post published on July 9, Google software engineers Appu Goundan and Qingyang Chen described Jib as a container image builder designed to handle all the steps involved in packaging a Java application into a container.
They say that containers make Java developers closer to the “write once, run anywhere” workflow, but containerising Java applications is not smooth: you must write Dockerfile, root and run the Docker daemon, waiting The build is complete, and the image finally push to the remote registry. Jib will handle all the steps of packaging an application into the container image process. It integrates directly with the Maven and Gradle Java development environments. You don’t need to write a Dockerfile or install Docker, add it as a plugin to your build. Containerize Java applications immediately.
Docker build process:
Jib build process:
Jib leverages the layering capabilities of the Docker image, provided as Maven and Gradle plugins, to optimise the Java container image build in the following ways:
- Simple – Jib is implemented in Java and runs as part of your Maven or Gradle build. You do not need to maintain a Dockerfile, run a Docker daemon, or even worry about creating a fat JAR with all its dependencies. 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.
- Fast – Jib takes advantage of image layering and registry caching to achieve fast, incremental builds. It reads your build config, organizes your application into distinct layers (dependencies, resources, classes) and only rebuilds and pushes the layers that have changed. When iterating quickly on a project, Jib can save valuable time on each build by only pushing your changed layers to the registry instead of your whole application.
- Reproducible – Jib supports building container images declaratively from your Maven and Gradle build metadata, and as such can be configured to create reproducible build images as long as your inputs remain the same.
Image: google blog