Skip to content

Instantly share code, notes, and snippets.

@adamw
Last active May 17, 2019 13:12
Show Gist options
  • Save adamw/17b6930bc0e6050ea6f9833baf2de345 to your computer and use it in GitHub Desktop.
Save adamw/17b6930bc0e6050ea6f9833baf2de345 to your computer and use it in GitHub Desktop.
val buildContainerCommand = Seq(
"docker",
"build",
"-t",
dockerGraalvmNativeImageName.value,
"-f",
(baseDirectory.value.getParentFile / "run-native-image" / "Dockerfile")
.getAbsolutePath,
resultDir.absolutePath
)
log.info("Building the container with the generated native image")
log.info(s"Running: ${buildContainerCommand.mkString(" ")}")
sys.process.Process(buildContainerCommand, 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