Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why include Scala? #251

Open
charpov opened this issue Jun 12, 2023 · 4 comments
Open

Why include Scala? #251

charpov opened this issue Jun 12, 2023 · 4 comments

Comments

@charpov
Copy link

charpov commented Jun 12, 2023

I've been maintaining my own java+sbt image for a few years, but I'd rather switch to yours to make my life simpler. I'm wondering why you include Scala in the image, given that sbt is all you need to run a project. Also, since sbt can download specific versions of itself, why specify a version at all? If all that was specified is the Java version, it would greatly simplify the tags. For instance, right now, there's no image for the latest LTS Java (17) latest sbt (1.9.0) and latest Scala (3.3.0). (Actually, there is; makes my point about having too many tags...)

@francisdb
Copy link
Collaborator

We try to bootstrap sbt for a certain scala version so that it is ready for use and does not require any further downloads.

I do agree that the separate scala we install is a bit overkill if you only want sbt as sbt will pull in scala in a different folder on bootstrap. Initially the idea was to have an image that could also be used for scala without using sbt. (before the repo was moved over here)

# 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 "// force sbt compiler-bridge download" > project/Dependencies.scala && \
echo "case object Temp" > Temp.scala && \
sbt compile && \
rm -r project && rm build.sbt && rm Temp.scala && rm -r target

Personally I would not mind removing the separate scala install but that will not change anything regarding labeling of sbt-scala image as we still want to bootstrap the sbt/scala combo.

@charpov
Copy link
Author

charpov commented Jun 12, 2023

Understood. I used to do that too (bootstrapping) but I eventually gave up. With good caching/volumes, I don't mind having everything downloaded one time. Smaller image with less frequent updates too.
I guess a plain eclipse-temurin-17 tag (with sbt and Scala set to whatever) would make my life easier, but I can manage without it.

@blandflakes
Copy link

blandflakes commented Feb 20, 2025

Wanted to check in on this issue - our team has many builds, and we are considering moving from our homegrown docker container to something more official that we're certain does things correctly.

However, these images present a challenge for a team that frequently updates libraries using a tool such as scala-steward. We have to update the image tag any time there's a new sbt version or scala version, which basically guarantees that we're constantly building with the "wrong" image.

How are others using these images in environments like this? Are there more generic "official" images that I just haven't found yet?

@charpov
Copy link
Author

charpov commented Feb 21, 2025

I would still much prefer a tag that is based solely on the Java version. The image can use any (recent) sbt and any Scala (or even no Scala at all). I'm setting up which sbt and which Scala I want in my project anyway. I would then use "latest Java 21" and be done with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants