DEV Community

Eduardo Issao Ito
Eduardo Issao Ito

Posted on

2

Changing the base Linux image in spring-boot:build-image

The spring-boot-maven-plugin can create an OCI image from a jar or war file using Cloud Native Buildpacks.

By default it uses a builder called paketobuildpacks/builder:base which is based on Ubuntu 18.04 and is suitable for running a Spring Boot application.

But you can choose another builder, for example:

  • paketobuildpacks/builder:tiny is a lot smaller because it has the minimum requirements to run you application, even sh is absent (you can't open a terminal in this image)
  • paketobuildpacks/builder:full its the oposite of tiny, containing a lot of tools and commands.
  • paketobuildpacks/builder-jammy-base is based on Ubuntu 22.04

The list of all builders is available in Paketo Builders Reference.

It's just a matter of configuring the builder in pom.xml:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <image>
            <builder>paketobuildpacks/builder-jammy-tiny</builder>
        </image>
    </configuration>
</plugin>
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (1)

Collapse
 
wldomiciano profile image
Wellington Domiciano

Awesome! Thanks for the tip

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more