I'm building a Docker image with a fat jar. I use the sbt-assembly
plugin to build the jar, and the sbt-native-packager
to build the Docker image. I'm not very familiar with SBT and am running into the following issues.
I'd like to declare a dependency on the
assembly
task from thedocker:publish
task, such that the fat jar is created before it's added to the image. I did as instructed in the doc, but it's not working.assembly
doesn't run until I invoke it.publish := (publish dependsOn assembly).value
One of the steps in building the image is copying the fat jar. Since assembly plugin creates the jar in
target/scala_whatever/projectname-assembly-X.X.X.jar
, I need to know the exactscala_whatever
and the jar name. assembly seems to have a keyassemblyJarName
but I'm not sure how to access it. I tried the following which fails.Cmd("COPY", "target/scala*/*.jar /app.jar")
Help!