Sample spring-boot applications that use spring-native.
docker run --name mysql -e MYSQL_DATABASE=testdb -e MYSQL_ROOT_PASSWORD=my-secret-pw -d -p 3306:3306 mysql:latest
Maven based spring-boot application using spring-data JPA, Swagger UI, Actuators, Prometheus Metrics, and spring-web MVC.
To compile, make sure JAVA_HOME
points to JDK 11 version of GraalVM and then run:
./mvnw -Pnative clean package
To run the executable:
target/simple-jpa-maven
To compile, make sure JAVA_HOME
points to regular JVM and Docker is running, then run:
./mvnw clean spring-boot:build-image
To run the OCI image with docker:
docker run -it -e 'SPRING_DATASOURCE_URL=jdbc:mysql://host.docker.internal:3306/testdb' -p 8080:8080 simple-jpa-maven:1.0
Grade based spring-boot application using spring-data JPA, Swagger UI, Actuators, Prometheus Metrics, and spring-web MVC.
To compile, make sure JAVA_HOME
points to JDK 11 version of GraalVM and then run:
./gradlew nativeCompile
To run the executable:
build/native/nativeCompile/simple-jpa-gradle
To compile, make sure JAVA_HOME
points to regular JVM and Docker is running, then run:
./gradlew clean bootBuildImage
To run the OCI image with docker:
docker run -it -e 'SPRING_DATASOURCE_URL=jdbc:mysql://host.docker.internal:3306/testdb' -p 8080:8080 simple-jpa-gradle:1.0