Code Monkey home page Code Monkey logo

Comments (1)

anthonydahanne avatar anthonydahanne commented on June 1, 2024

just a (arm64) note : spring-boot Maven and Gradle plugins use, by default,

  • the builders named paketobuildpacks/builder-jammy-base:latest or paketobuildpacks/builder-jammy-tiny:latest when native is activated - none of them support dual arch (yet) ❌
  • the (composite )buildpacks named paketobuildpacks/java:latest or, when native is enabled, paketobuildpacks/java-native-image:latest both of them are published as dual arch now ✅

To benefit from dual arch support, the users have to specify an alternative builder: paketobuildpacks/builder-jammy-buildpackless-tiny:latest which is dual arch - otherwise, the arm64 path is not complete and won't allow users to use Java buildpacks arm64 flavor.

Since this builder is buildpackless users have to manually specify the buildpacks they need.

Maven:

<plugin>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-maven-plugin</artifactId>
	<executions> <!-- not necessary for arm64, but better take good habits now-->
		<execution> 
			<id>process-aot</id>
			<goals>
				<goal>process-aot</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<image>
			<env> <!-- not necessary for arm64, but better take good habits now-->
				<BP_JVM_CDS_ENABLED>true</BP_JVM_CDS_ENABLED>
				<BP_SPRING_AOT_ENABLED>true</BP_SPRING_AOT_ENABLED>
			</env>
			<buildpacks>
				<buildpack>paketobuildpacks/java</buildpack>
			</buildpacks>
			<builder>paketobuildpacks/builder-jammy-buildpackless-tiny</builder>
		</image>
	</configuration>
</plugin>

Gradle:

plugins {
[...]
	id("org.graalvm.buildtools.native") version "0.10.1" // not necessary for arm64, but better take good habits now
}
[...]
tasks.bootBuildImage {
	builder.set("paketobuildpacks/builder-jammy-buildpackless-tiny")
	buildpacks.add("gcr.io/paketo-buildpacks/java")
	environment.put("BP_SPRING_AOT_ENABLED","true") // not necessary for arm64, but better take good habits now
	environment.put("BP_JVM_CDS_ENABLED","true") // not necessary for arm64, but better take good habits now
}

There is no scheduled date when the default builders paketobuildpacks/builder-jammy-base:latest and paketobuildpacks/builder-jammy-tiny:latest will be published as dual arch(the best bet is to wait for the Ubuntu Noble based builders that will all be dual arch from day one and should arrive soon, but not for SB 3.3)

from spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.