Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dockerizing Scala Application
// No need to run tests while building jar
test in assembly := {}
// Simple and constant jar name
assemblyJarName in assembly := s"app-assembly.jar"
// Merge strategy for assembling conflicts
assemblyMergeStrategy in assembly := {
case PathList("reference.conf") => MergeStrategy.concat
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case _ => MergeStrategy.first
}
FROM openjdk:8-jre-alpine
RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY ./run_jar.sh ./app-assembly.jar ./
ENTRYPOINT ["./run_jar.sh"]
// sbt-assembly for "fat jars"
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
#!/usr/bin/env sh
java $* -jar app-assembly.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.