如何从命令行配置由 GraalVM Native Image 本机编译的 Spring 启动应用程序的端口?

How to configure the port of a Spring Boot app that's natively compiled by GraalVM Native Image from command line?

Spring Boot 通过引入 Spring Graal Native 0.6.0 feature. Now if we have a successfully compiled native Spring Boot app, how can we dynamically change the port of an application at startup on the commandline (as we are used to in JVM mode)?

引入了 GraalVM Native Image 支持

这对于 Docker 或云提供商的部署场景至关重要...

因为我们已经习惯在 JVM 模式下执行此操作,例如:

java -Dserver.port=8087 -jar spring-boot-graal-0.0.1-SNAPSHOT.jar

我们可以对本机编译的 Spring 引导应用执行相同的操作:

./spring-boot-graal -Dserver.port=8087

感谢! See 100% comprehensible example project here: https://github.com/jonashackt/spring-boot-graalvm