Jib builds optimized Docker and OCI images for Java apps without a Docker daemon. It ships as Maven and Gradle plugins, a core library, and a CLI.
Overview
Jib helps teams package Java applications as container images directly from Maven or Gradle builds, without writing Dockerfiles or calling docker build. It also offers Jib Core as a general-purpose container-building library and Jib CLI for command-line image builds.
The build splits your application into multiple layers, separating dependencies from application classes. When code changes, only the affected layers are rebuilt and pushed, which speeds iterative deploys. Rebuilding with the same contents yields the same image, so registries do not see unnecessary updates.
Images layer on top of a default OpenJDK base, with support for custom base images. Builds can push to a registry of your choice from the build tool, reducing reliance on a local Docker daemon. Examples cover Spring Boot, Micronaut, multi-module layouts, and related Java stacks.
The approach differs from a single fat JAR in one image layer: granular layers map to how Java apps are structured so incremental publishes change less on each deploy.
Key features
- Maven and Gradle plugins
- Layered dependency and class splits
- No Docker daemon required
- Push to any registry from the build
- Reproducible image output
- Configurable base images
- Jib Core library API
- Jib CLI for standalone builds
Use cases
- Containerizing Spring Boot services
- CI builds without Docker installed
- Faster Java deploy cycles
- Micronaut container images
- Multi-module Java projects