diff --git a/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala b/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala index 5e2a6d376..a4916bcfc 100644 --- a/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala @@ -52,12 +52,14 @@ object GraalVMNativeImagePlugin extends AutoPlugin { graalVMNativeImageGraalVersion.value match { case Some(splitPackageVersion(packageName, tag)) => packageName match { - case "graalvm-community" => Def.task(Some(s"$GraalVMBaseImagePath$packageName:$tag"): Option[String]) - case _ => + case "native-image-community" | "native-image" => + Def.task(Some(s"$GraalVMBaseImagePath$packageName:$tag"): Option[String]) + case "graalvm-community" | "graalvm-ce" => generateContainerBuildImage( - s"${GraalVMBaseImagePath}graalvm-ce:$tag", + s"${GraalVMBaseImagePath}$packageName:$tag", graalVMNativeImagePlatformArch.value ) + case _ => sys.error("Other ghcr.io/graalvm images are unsupported") } case Some(tag) => generateContainerBuildImage(s"${GraalVMBaseImagePath}graalvm-ce:$tag", graalVMNativeImagePlatformArch.value) @@ -170,7 +172,6 @@ object GraalVMNativeImagePlugin extends AutoPlugin { "-v", s"${targetDirectory.getAbsolutePath}:$graalDestDir", image, - "native-image", "-cp", (resourcesDestDir +: classpathJars.map(jar => s"$stageDestDir/" + jar._2)).mkString(":"), s"-H:Name=$binaryName" @@ -228,7 +229,7 @@ object GraalVMNativeImagePlugin extends AutoPlugin { Cmd("WORKDIR", "/opt/graalvm"), ExecCmd("RUN", "gu", "install", "native-image"), ExecCmd("RUN", "sh", "-c", "ln -s /opt/graalvm-ce-*/bin/native-image /usr/local/bin/native-image"), - ExecCmd("CMD", "native-image") + ExecCmd("ENTRYPOINT", "native-image") ).makeContent val command = dockerCommand ++ Seq( diff --git a/src/sbt-test/graalvm-native-image/docker-native-image-arm64/build.sbt b/src/sbt-test/graalvm-native-image/docker-native-image-arm64/build.sbt index 8a71e3400..bd23343a2 100644 --- a/src/sbt-test/graalvm-native-image/docker-native-image-arm64/build.sbt +++ b/src/sbt-test/graalvm-native-image/docker-native-image-arm64/build.sbt @@ -3,5 +3,5 @@ enablePlugins(GraalVMNativeImagePlugin) name := "docker-test" version := "0.1.0" graalVMNativeImageOptions := Seq("--no-fallback") -graalVMNativeImageGraalVersion := Some("graalvm-community:17.0.8") +graalVMNativeImageGraalVersion := Some("native-image-community:17.0.8") graalVMNativeImagePlatformArch := Some("arm64") diff --git a/src/sbt-test/graalvm-native-image/docker-native-image-legacy-specify-package/build.sbt b/src/sbt-test/graalvm-native-image/docker-native-image-legacy-specify-package/build.sbt index 2f60ef3e7..38b1dd18c 100644 --- a/src/sbt-test/graalvm-native-image/docker-native-image-legacy-specify-package/build.sbt +++ b/src/sbt-test/graalvm-native-image/docker-native-image-legacy-specify-package/build.sbt @@ -3,4 +3,4 @@ enablePlugins(GraalVMNativeImagePlugin) name := "docker-test" version := "0.1.0" graalVMNativeImageOptions := Seq("--no-fallback") -graalVMNativeImageGraalVersion := Some("graalvm-ce:22.3.3") +graalVMNativeImageGraalVersion := Some("native-image:22.3.3")