Must-have for Spring Boot Services

Supercharge your app with Alpaquita Containers

Save up to 30% of RAM instantly
  • Less memory consumption
  • Less cloud spending
  • 24/7/365 Support and LTS releases
BellSoft is Trusted by leading ISVs
Spring LogoVMware LogoJetBrains Logo

Experience 100% Harmony of Linux
and JDK

By integrating Alpaquita Linux and Liberica JDK Lite in a container, we achieved better speed, enhanced security, and improved overall performance.

Alpaquita Linux -
Designed to run Java in containers
  • Minimal memory footprint with base image size of 3.28 MB;
  • Better performance thanks to kernel optimizations, memory management, optimized mallocs;
  • Enhanced flexibility with glibc and both standard and optimized musl available.
Liberica JDK Lite
Lean JDK for Cloud Environments
  • Free and open source software with LTS releases and commercial support;
  • Lower memory consumption, meaning it reduces infrastructure costs;
  • Liberica JDK is a default Java runtime in Spring Boot.

Achieve Maximum Results Without Compromises

Cost Savings

Thanks to their tiny size, remarkable performance, and unwavering stability, these containers optimize resource utilization, ultimately reducing your infrastructure costs.

Seamless Migration

Switching to Alpaquita Containers is a breeze. With no migration effort required, you can seamlessly transition from your existing containers to BellSoft’s innovative solution.

Free Development and Deployment

We believe in empowering our users to explore, innovate, and create. That's why Alpaquita Containers are absolutely free for development, testing, and deployment.

Unparalleled Security

With custom build options, kernel hardening, process isolation, and regular security updates, we prioritize your security and ensure that your containers remain shielded from potential threats.

Memory Reduction Proven:
up to 30% Improvement

To demonstrate the benefits of using Alpaquita containers over the traditional method of running Java applications, we compared performance of Alpaquita + Liberica Lite vs OpenJDK + DockerHub.

The following tests measure the RAM consumed by the same app launched within two images:

Note that while the “official” image is not supported anymore, it can be used as the “average” OpenJDK implementation and the reference point. You can use other distros in tests, for example, “temurin”, which is supported. See the list in the “kits” file.

Step 1: Download the scripts

First, download measurement scripts (tested on Mac, Linux, and Windows) from the GitHub repository.

Step 2: Refresh Docker and buildx

You will need Docker to enable the buildx command, so install it if necessary. Next, check the version of the buildx command by launching docker buildx version. The version we needed was v0.8 or higher, the scripts were tested on v0.10.3, the latest at the moment of testing. If your buildx version is too low, install the new one.

Step 3: Create builder

For buildx to run, you need to configure it by running create_builder or create_builder.bat for Windows.

Step 4: Build the application for testing

Now, it is time to choose what app you are going to test, your own or demo (in our case, Spring Petclinic).
If you decide to utilize Petclinic, run the ./bake script (Mac, Linux), or bake.bat (Windows).
Wait some time and check the results in the target folder.
In case you use your app, build the JAR file and then put it into the target folder of the project.
The name of the file must be “app.jar”.
Run the ./bake custom (Mac, Linux) or bake.bat custom (Windows).

Step 5: Run the tests

In case you use Petclinic, just run the ./test script with no parameters.
If you use your own app, run the same script with a single argument, which is the address where your app listens for connections (like ./test http://localhost:9090/endpoint).

Step 6: Wait for a bit

The script launches several processes:

  • Downloading several necessary artifacts from Maven Central (for Petclinic);
  • Java application building (for Petclinic);
  • Loading and building of wrk2 and psrecord (which is a native C++ code and will take a lot of time);
  • Loading and building the Python modules for the traffic analysis (pandas, numpy);
  • Running the tests.

You may need to wait for a while.

Step 7: Analyze the results

To check the image size, run the docker images command and look for two images,petclinic-alpaquita and petclinic-official.

Retrieve the results from the logs folder. Other than the logs that display the RAM load results, there are two more important files: frequency.png и median.png.
median.png is the graph that shows the median values of RAM consumption for both images. The frequency.png graph displays the frequency distribution of RAM consumption by images. The X-axis represents the RAM consumption, the Y-axis shows how much time the application managed to hold the corresponding level of RAM consumption. The second graph could be more important for analysis but is more difficult to interpret.petclinic-alpaquita and petclinic-official.

Step 8: Share your results!

We hope you will share the results of your testing with the world! Please mention us (https://twitter.com/bellsoftware) in your reply so we can answer your questions and see your results.

Here are the findings from our tests, clearly highlighting the superior performance of the Alpaquita container in comparison to the OpenJDK + Docker approach.

Image size

Image size

RAM consumption

RAM consumption

Try It Yourself And Measure the Impact of
Alpaquita Container on Your Spring App

Once you have completed building your container, you can measure the effects of Alpaquita Containers on RAM and their memory usage. Follow the steps provided below.

This is the list of useful Docker commands that may help.

  • To check how much disk space the image takes, run

    docker image ls demo-app

    The result should be similar to the output below:

    REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
    demo-app     latest    24ac5ac02b2a   43 years ago   152MB
  • To find out the OS version in package, run

    docker run --rm -it --entrypoint /bin/cat demo-app /etc/os-release

    For our image, the result should be:

    NAME="BellSoft Alpaquita Linux Stream"
    ID=alpaquita
    ID_LIKE=alpine
    VERSION_ID=23
    PRETTY_NAME="BellSoft Alpaquita Linux Stream 23 (musl)"
    HOME_URL="https://bell-sw.com/"
    BUG_REPORT_URL="https://bell-sw.com/support/"
    LIBC_TYPE=musl
    
  • Last but not least, let’s see what is inside the container built by Paketo without unpacking it. Run the following command (which is built into the Paketo):

    pack inspect demo-app

    If you used the Petclinic app, the result will likely be the following:

    Inspecting image: demo-app
    
    REMOTE:
    (not present)
    
    LOCAL:
    
    Stack: io.buildpacks.stacks.alpaquita-musl
    
    Base Image:
      Reference: 116beca369efbba0a9dfff7361b7ce7c302cac684904ddc365e7d6ba82505f58
      Top Layer: sha256:7caddaa60b9c1ca8f0dfa5882f96239493ef54e94e5e8c47ddf84745186eff35
    
    Run Images:
      bellsoft/buildpacks.alpaquita-run:musl
    
    Buildpacks:
      ID                                      VERSION        HOMEPAGE
      bellsoft/buildpacks/liberica            1.0.0          https://github.com/bell-sw/buildpacks/liberica
      paketo-buildpacks/syft                  1.26.0         https://github.com/paketo-buildpacks/syft
      paketo-buildpacks/gradle                6.11.0         https://github.com/paketo-buildpacks/gradle
      paketo-buildpacks/maven                 6.13.0         https://github.com/paketo-buildpacks/maven
      paketo-buildpacks/executable-jar        6.6.1          https://github.com/paketo-buildpacks/executable-jar
      paketo-buildpacks/spring-boot           5.23.0         https://github.com/paketo-buildpacks/spring-boot
    
    Processes:
      TYPE                  SHELL        COMMAND        ARGS                                              WORK DIR
      web (default)                      java           -jar /workspace/spring-petclinic-3.0.0.jar        /workspace
      executable-jar                     java           -jar /workspace/spring-petclinic-3.0.0.jar        /workspace
      task                               java           -jar /workspace/spring-petclinic-3.0.0.jar        /workspace
    

We will be glad if you share your results with us! To do that, click on the button below.

Contact us

Enjoy Being up to 30% More Efficient

Optimize your budget: switch to Alpaquita Containers to save on infrastructure costs and invest in enhanced features and services.

Alpaquita Buildpack Now Available too

Take your Spring Boot services to new heights in two easy steps with Alpaquita Buildpack.

  • Install Paketo
    Install Paketo:

    Seamlessly integrate Paketo into your development workflow.

  • Execute a Few Lines of Code
    Execute a Few Lines of Code

    Experience the magic as your Spring Boot services operate optimally within the Paketo environment

  • How to install Alpaquita Buildpack

    We have created several pack utilities to enhance your experience and help you assess the impact of Alpaquita Container on your application. Be sure to share your feedback with us as we greatly appreciate hearing success stories from our clients.

    Install the pack utility. Check this guide for the instructions.

    Edit pom.xml:

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
    		    <name>paketo-maven</name>
                        <builder>bellsoft/buildpacks.builder:musl</builder>
                    </image>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
    
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    

    Build the image with Maven: mvn spring-boot:build-image

    Launch the container: docker run paketo-maven

    Install the pack utility. Check this guide for the instructions.

    Edit build.gradle:

    plugins {
    	id 'java'
    	id 'org.springframework.boot' version '3.0.6'
    	id 'io.spring.dependency-management' version '1.1.0'
    }
    
    dependencies {
    	implementation 'org.springframework.boot:spring-boot-starter'
    	testImplementation 'org.springframework.boot:spring-boot-starter-test'
    }
    
    bootBuildImage {
    	imageName = "paketo-gradle"
    	builder = "bellsoft/buildpacks.builder:musl"
    }
    

    Build the image with Maven: gradle bootBuildImage

    Launch the container: docker run paketo-gradle

    Install the pack utility. Check this guide for the instructions.

    Edit build.gradle.kts:

    plugins {
    	java
    	id("org.springframework.boot") version "3.0.6"
    	id("io.spring.dependency-management") version "1.1.0"
    }
    
    dependencies {
    	implementation("org.springframework.boot:spring-boot-starter")
    	testImplementation("org.springframework.boot:spring-boot-starter-test")
    }
    
    tasks.bootBuildImage {
    	imageName.set("paketo-gradle-kotlin")
    	builder.set("bellsoft/buildpacks.builder:musl")
    }
    

    Build the image with Maven: gradle bootBuildImage

    Launch the container: docker run paketo-gradle-kotlin

    If you don't have a project ready for testing, visit Spring Initilizr and create it there. It will contain all the dependencies, so all you will have to do is add the configuration for bootBuildImage, or run pack with required parameters.

    In this example, we use Spring Petclinic as the application we put into the buildpack. You can use your app instead when you are ready.

    The following code will return a copy of Petclinic from the most recent commit at the time of writing of this tutorial:

    curl -L https://github.com/spring-projects/spring-petclinic/archive/a5cbb8505a1df3c348c06607933a07fc8c87c222.zip --output spring-petclinic-main.zip
    
    unzip ./spring-petclinic-main.zip
    
    mv ./spring-petclinic-a5cbb8505a1df3c348c06607933a07fc8c87c222 ./spring-petclinic-main
    
    cd ./spring-petclinic-main && ./mvnw package

    After you finish building your container, you can check out its size, the version of Alpaquita inside, and the contents of the package. See for yourself how Packeto buildpacks creates the production-ready Docker images with Alpaquita inside!

    This is the list of useful Docker commands that may help.

    • To check how much disk space the image takes, run

      docker image ls demo-app

      The result should be similar to the output below:

      REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
      demo-app     latest    24ac5ac02b2a   43 years ago   152MB
    • To find out the OS version in package, run

      docker run --rm -it --entrypoint /bin/cat demo-app /etc/os-release

      For our image, the result should be:

      NAME="BellSoft Alpaquita Linux Stream"
      ID=alpaquita
      ID_LIKE=alpine
      VERSION_ID=23
      PRETTY_NAME="BellSoft Alpaquita Linux Stream 23 (musl)"
      HOME_URL="https://bell-sw.com/"
      BUG_REPORT_URL="https://bell-sw.com/support/"
      LIBC_TYPE=musl
      
    • Last but not least, let’s see what is inside the container built by Paketo without unpacking it. Run the following command (which is built into the Paketo):

      pack inspect demo-app

      If you used the Petclinic app, the result will likely be the following:

      Inspecting image: demo-app
      
      REMOTE:
      (not present)
      
      LOCAL:
      
      Stack: io.buildpacks.stacks.alpaquita-musl
      
      Base Image:
        Reference: 116beca369efbba0a9dfff7361b7ce7c302cac684904ddc365e7d6ba82505f58
        Top Layer: sha256:7caddaa60b9c1ca8f0dfa5882f96239493ef54e94e5e8c47ddf84745186eff35
      
      Run Images:
        bellsoft/buildpacks.alpaquita-run:musl
      
      Buildpacks:
        ID                                      VERSION        HOMEPAGE
        bellsoft/buildpacks/liberica            1.0.0          https://github.com/bell-sw/buildpacks/liberica
        paketo-buildpacks/syft                  1.26.0         https://github.com/paketo-buildpacks/syft
        paketo-buildpacks/gradle                6.11.0         https://github.com/paketo-buildpacks/gradle
        paketo-buildpacks/maven                 6.13.0         https://github.com/paketo-buildpacks/maven
        paketo-buildpacks/executable-jar        6.6.1          https://github.com/paketo-buildpacks/executable-jar
        paketo-buildpacks/spring-boot           5.23.0         https://github.com/paketo-buildpacks/spring-boot
      
      Processes:
        TYPE                  SHELL        COMMAND        ARGS                                              WORK DIR
        web (default)                      java           -jar /workspace/spring-petclinic-3.0.0.jar        /workspace
        executable-jar                     java           -jar /workspace/spring-petclinic-3.0.0.jar        /workspace
        task                               java           -jar /workspace/spring-petclinic-3.0.0.jar        /workspace
      

    Start using Alpaquita Linux today!

    These are all the links and additional info you may need to try and use Alpaquita Linux with your Spring Boot applications:

    Alpaquita Cloud Native Platform

    Get all the benefits of Alpaquita buildpacks with native image technology integrated for even lower size and better startup time, and commercial support.

    Learn more
    media

    Discover Alpaquita Linux

    Learn more about a full-featured operating system optimized for Java.

    Learn more

    Learn to dockerize Spring boot apps

    See all the steps of dockerizing a Spring Boot app using a microcontainer with Liberica Lite and Alpaquita Linux.

    Learn more

    Spring Boot 3 with GraalVM Native image

    Look into the configuration of Spring Boot apps for native image technology and avoiding migration issues

    Learn more

    More on Spring Boot and GraalVM Native image

    Find out the intricacies associated with Spring Boot Native Image development

    Learn more
    Contact Form Background

    Get guidance on migrating to Alpaquita Cloud Native Platform

    Speak with an expert to see which solution will serve your business the best

    * This field is required