Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Jib, a Java Container Image Builder from Google

Jib, a Java Container Image Builder from Google

Leia em Português


Google recently announced Jib, an open-source container image builder that lets Java developers build Java containers using well-known Java tools such as Maven or Gradle. Developers are not required to write a Dockerfile or have Docker installed in order to build an image.

Jib is implemented in Java and runs as part of a Maven or Gradle build. Jib's build approach separates the Java application into multiple layers, so when there are any code changes, only those changes are rebuilt, rather than the entire application. By default, these layers are layered on top of a distroless base image, which is an image that contains only the developer's application and its runtime dependencies. The following images compare the Docker and Jib build flows:

Docker build flow:

Jib build flow:

To start using Jib, developers just need to add one of the available plugins for Maven or Gradle to the build file and configure the target image. Below are some examples illustrating a build to a container registry and a to a Docker daemon:


# Builds to a container image registry.
$ mvn compile jib:build
# Builds to a Docker daemon.
$ mvn compile jib:dockerBuild


plugins {
  id '' version '0.9.8'
} = 'myimage'
# Builds to a container image registry.
$ gradle jib
# Builds to a Docker daemon.
$ gradle jibDockerBuild

For users who require authenticating with private registries, Jib provides Docker credential helpers. Users can also define credentials in their Maven settings. Some common credential helpers included are Google Container Registry, AWS Elastic Container Registry, and Docker Hub Registry. The following is an example using credential helpers:


More information can be found on the GitHub repo.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.