Created
January 1, 2020 09:59
-
-
Save TomLous/5172684dd61a18696689ba9735e46a23 to your computer and use it in GitHub Desktop.
build.sbt part 3 for Medium Post
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 targetDockerJarPath = "/opt/spark/jars" | |
// For building the docker image | |
lazy val dockerSettings = Seq( | |
imageNames in docker := Seq( | |
ImageName(s"$domain/${name.value}:latest"), | |
ImageName(s"$domain/${name.value}:${version.value}"), | |
), | |
buildOptions in docker := BuildOptions( | |
cache = false, | |
removeIntermediateContainers = BuildOptions.Remove.Always, | |
pullBaseImage = BuildOptions.Pull.Always | |
), | |
dockerfile in docker := { | |
// The assembly task generates a fat JAR file | |
val artifact: File = assembly.value | |
val artifactTargetPath = s"$targetDockerJarPath/$domain-${name.value}.jar" | |
new Dockerfile { | |
from(s"localhost:5000/spark-runner") | |
}.add(artifact, artifactTargetPath) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment