Created
May 17, 2019 13:11
-
-
Save adamw/caa9bb0355ff809106031e937023ce32 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val runNativeImageCommand = Seq( | |
"docker", | |
"run", | |
"--rm", | |
"-v", | |
s"${cpDir.getAbsolutePath}:/opt/cp", | |
"-v", | |
s"${resultDir.getAbsolutePath}:/opt/graalvm", | |
"graalvm-native-image", | |
"-cp", | |
"/opt/cp/*", | |
"--static", | |
s"-H:Name=$resultName", | |
className | |
) | |
log.info("Running native-image using the 'graalvm-native-image' docker container") | |
log.info(s"Running: ${runNativeImageCommand.mkString(" ")}") | |
sys.process.Process(runNativeImageCommand, resultDir) ! streams.value.log match { | |
case 0 => resultDir / resultName | |
case r => sys.error(s"Failed to run docker, exit status: " + r) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment