Search code examples
spring-bootdockerjib

What is the difference between spring-boot:build-image vs jib?


Spring Boot 2.3.x adds the capability of building a Docker image using their plugin via spring-boot:build-image. Jib seems to allow the same functionality but is not limited to Spring boot.

Is there any specific optimizations that Spring Boot applications avail of that jib does not provide (which is why there's a spring boot plugin for it?)

Aside from being unable to use boot image with a private registry.


Solution

  • The main difference between Jib and Spring Boot's image building is that the later uses Buildpacks to create the image. There's a comparison table on buildpacks.io that lists some of the most notable differences.

    It's subjective, but the rebasing support is perhaps the most notable. Rebasing an image allows the layer or layers that contain the application code to be rebased on top of a new operating system or JVM layer without having to rebuild the application. This allows OS and JVM security updates to be applied far more quickly than if every application and its entire image had to be rebuilt in order to consume the update.