Quantisan / docker-clojure

Official Docker image for Clojure
https://hub.docker.com/_/clojure/
MIT License
204 stars 34 forks source link

[Documentation] I think it would be useful to provide docs for artifacts caching #131

Open ieugen opened 3 years ago

ieugen commented 3 years ago

Hello,

When building Clojure apps a lot of artifacts get downloaded. These can be cached between re-runs for people where this makes sense.

This should improve image build speed - esp in CI servers.

I think more people would use this feature if they new they could and knew where the artifacts are stored in the image so they can mount volumes there.

WDYT? Eugen

cap10morgan commented 3 years ago

Sure, we could use some more docs around this. However, there's nothing particularly special about Docker here. The local maven repo is in $HOME/.m2/repository like anywhere else.

And otherwise most of this involves adding in your project.clj, deps.edn, or build.boot (or whatever, I'm not a boot user) file first, installing deps, and then adding in the rest of your code / JAR / whatever so that you only break the deps cache when the file that defines what they are changes. That's pretty common across Docker usage w/ lang-specific dependency managers.

But I've been meaning to re-organize the docs anyway, so I can add a section that spells this all out in there when I do.

practicalli-johnny commented 1 year ago

https://practical.li/blog/posts/build-and-run-clojure-with-multistage-dockerfile/ article covers using the Offical Clojure Docker image for building Clojure and leveraging the docker cache

Feel free to link or use the content (creative commons attribution license)

Thank you.