BAEL-6527 GraalVM Native Image Docker Image (#14835)

* BAEL-6527 GraalVM Native Image Docker Image

* BAEL-6527 GraalVM Native Image Docker Image
This commit is contained in:
Somnath Musib 2023-10-03 01:07:18 +03:00 committed by GitHub
parent 40c5ed0c6f
commit b52e2cc3d1
5 changed files with 70 additions and 0 deletions

View File

@ -104,6 +104,7 @@
<module>spring-boot-springdoc-2</module>
<module>spring-boot-documentation</module>
<module>spring-boot-3-url-matching</module>
<module>spring-boot-graalvm-docker</module>
</modules>
<dependencyManagement>

View File

@ -0,0 +1,3 @@
FROM ubuntu:jammy
COPY target/springboot-graalvm-docker /springboot-graalvm-docker
CMD ["/springboot-graalvm-docker"]

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-3</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-3</relativePath>
</parent>
<groupId>com.baeldung</groupId>
<artifactId>spring-boot-graalvm-docker</artifactId>
<version>1.0.0</version>
<name>spring-boot-graalvm-docker</name>
<description>Spring Boot GrralVM with Docker</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,24 @@
package com.baeldung.graalvmdockerimage;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
public class GraalvmDockerImageApplication {
public static void main(String[] args) {
SpringApplication.run(GraalvmDockerImageApplication.class, args);
}
}
@RestController
class HelloController {
@GetMapping
public String hello() {
return "Hello GraalVM";
}
}