sbt/docker-sbt

Images for cross build between different scala versions

payurgin opened this issue · 3 comments

It would be great to have an image with more than one scala version installed.
It will be useful for project with cross builds between different scala versions (2.12.10 and 2.13.1 for example).

Actually you do not at all need a Scala installation to use sbt to (cross) build Scala projects.

The Scala install exists mainly for historical reasons and maybe for using the REPL.

I mean warm cache. It executes only for one version of scala.

# Prepare sbt (warm cache)
RUN \
  sbt sbtVersion && \
  mkdir -p project && \
  echo "scalaVersion := \"${SCALA_VERSION}\"" > build.sbt && \
  echo "sbt.version=${SBT_VERSION}" > project/build.properties && \
  echo "case object Temp" > Temp.scala && \
  sbt compile && \
  rm -r project && rm build.sbt && rm Temp.scala && rm -r target

I see. Well, that would mean way too many additional options for the build, because there are so many Scala versions. If you need to cross build against specific versions, please create your own Docker image on top of this one with your specific settins.