Skip to content

Instantly share code, notes, and snippets.

Created November 3, 2017 07:39
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 ./ ./app-assembly.jar ./
// 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