Building Java Docker images has never been easier

Jib 1.0.0 is fully ready and stable for production use

Eirini-Eleni Papadopoulou
Shutterstock / MicroOne  

We all know that containerizing Java applications is anything but simple. But Jib is an open-source Java containerizer from Google that aspires to change that! In this article, we take a look at its first milestone release and its features.

Many months ago, we introduced Jib for the first time – an open-source Java containerizer created by Google that lets Java developers build containers using the Java tools they are familiar with. It builds Docker and OCI images for your Java applications and is available as a plugin for Maven and Gradle.

The main goals behind its creation were:

  • Be fast – Deploy your changes fast. Jib separates your application into multiple layers, splitting dependencies from classes. Now you don’t have to wait for Docker to rebuild your entire Java application – just deploy the layers that changed.
  • Be reproducible – Rebuilding your container image with the same contents always generates the same image. Never trigger an unnecessary update again.
  • Be daemonless – Reduce your CLI dependencies. Build your Docker image from within Maven or Gradle and push to any registry of your choice. No more writing Dockerfiles and calling docker build/push.

And today, we are back to give you a tour of the first milestone release!

Jib 1.0.0 goes GA and its goal remains the same – to make building Java Docker images easier than ever!

Let’s have a look at the new release.

What’s new in Jib 1.0?

Containerize WAR projects – Jib can now containerize WAR projects as well, with no extra configuration – The default application server in the container is Jetty, but you can also use a different server like Tomcat by configuring the base image and appRoot.

Integration with Skaffold – Jib is now available as a builder in Skaffold. To start using Skaffold with your Java project, install Skaffold and add a skaffold.yaml to your project. Make sure you have your Kubernetes manifests in a k8s/ directory and that the image reference in a Container spec matches

Jib Core – Jib runs on its own general-purpose library for building container images, which has been released as Jib Core along with some API refinements. Now you can use Jib as more than just Maven and Gradle plugins – you can build containers in Java without a Docker daemon, for any application.

Head over to the official release notes to find out all the relevant information on the new features as well as specific examples.

SEE ALSO: Meet Kalium, a reactive Java framework for microservices

Getting started

You can containarize your application on Maven or Gradle, you need a single command!

For Maven:
mvn compile -Dimage=

For Gradle:
gradle jib --image=

Find out all the information on how to get started in the quickstart guide for Maven and Gradle.

Eirini-Eleni Papadopoulou
Eirini-Eleni Papadopoulou was the editor for Coming from an academic background in East Asian Studies, she decided that it was time to go back to her high-school hobby that was computer science and she dived into the development world. Other hobbies include esports and League of Legends, although she never managed to escape elo hell (yet), and she is a guest writer/analyst for competitive LoL at TGH.

Inline Feedbacks
View all comments