docker-clojure
docker-clojure copied to clipboard
Question: does it make sense to merge lein and tools.deps images?
Given that the image size is absolutely dominated by JDK (~300 Mb uncompressed), would it be reasonable to ship both Leiningen (~15 Mb uncompressed) and tools.deps (around the same but also needs Git installed) in the single image, kinda like what is done for latest
? There are a couple of projects that use both on CI and such projects could benefit from such a change. Are there any drawbacks apart from increased image size?
Hmm... I could see that making sense; especially if we stop shipping the boot variants soon (which I think we should). The full version tags would get a bit unwieldy... E.g. clojure:temurin-21-lein-2.11.0-tools-deps-1.11.2.1435
. But we could also push tags that only specify their lein version or their tools-deps version (but they would all still include both tools) for those who only use one or the other.
What a mess we've got in our tooling these days. Sigh. 😉
What do you think, @Quantisan?
Posted it to the #docker channel in Clojurians Slack to see what folks think in there: https://clojurians.slack.com/archives/C0PME9N9X/p1713539776559319
But we could also push tags that only specify their lein version or their tools-deps version (but they would all still include both tools) for those who only use one or the other.
I like this idea!
Regarding boot: it makes sense dropping it since the old images will still exists, and whoever keeps using it can always build their own images.
tl;dr; I don't see any problem.
Speaking out loud my initial worry that turns out to be moot. My first concern would be potential conflict for dependencies. But this is about building an image and not using them in the same JDK project. i.e. like most people, I have both tools installed on my machine too. And it's fine. So I guess it's ok in an image too.
For the record, I had a look at the dependencies.
https://github.com/clojure/tools.deps/blob/master/deps.edn
versus
https://github.com/technomancy/leiningen/blob/github/project.clj -> https://github.com/technomancy/leiningen/blob/github/leiningen-core/project.clj -> https://github.com/clj-commons/pomegranate/blob/master/deps.edn
I see these dependency conflicts:
-org.clojure/data.xml
: Lein uses version 0.2.0-alpha6, while the Deps project uses version 0.2.0-alpha9
-org.apache.maven/maven-resolver-provider
: Lein is on 3.8.7
, while Deps is at 3.8.8
- a bunch of overlaps related to
org.apache.maven.resolver/*
- Deps excludes
com.google.guava/guava
fromorg.apache.maven/maven-core
, but Lein doesn't manage this dependency
Again, this only matters if you use both in your Clojure project.
Another issue: tools-deps and Leiningen have different CMDs (lein repl
and clj
) and different entrypoints. If the images are merged into one, then we'll have to settle on a single entrypoint, and that would be compatibility-breaking.
The possible solution is to still have both in all images, but have -lein
variants with Leiningen entrypoints and -tools-deps
(and default) variants with tools.deps entrypoints.
Another issue: tools-deps and Leiningen have different CMDs (
lein repl
andclj
) and different entrypoints. If the images are merged into one, then we'll have to settle on a single entrypoint, and that would be compatibility-breaking.The possible solution is to still have both in all images, but have
-lein
variants with Leiningen entrypoints and-tools-deps
(and default) variants with tools.deps entrypoints.
Yeah I think we should vary it based on the tag we're building. And for tags that include both (incl. latest
), let's use the tools.deps entrypoint (as the first party option).