Quantisan / docker-clojure

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

Create /root/.lein/ directory in advance #232

Closed alexander-yakushev closed 6 months ago

alexander-yakushev commented 6 months ago

lein repl is currently broken in all Leiningen-based images because Leiningen can't write to /root/.lein directory because it doesn't exist. This PR fixes that by creating the dir in advance.

Current behavior:

docker run -ti --rm clojure:temurin-21-lein-alpine lein repl
java.io.IOException: Permission denied. Please check your access rights for /root/.lein/repl-port

Context: https://clojurians.slack.com/archives/C0PME9N9X/p1716875441293819

cap10morgan commented 6 months ago

This is arguably a lein bug. It relies on the fact that the official installer script downloads the jar file to ~/.lein/self-installs/ and thus that directory already exists when using that installation method. We're not using that installer to have more control over which version we're installing and maybe some other reasons I'm forgetting (perhaps we don't need to?).

But this seems like a fine workaround for now. 👍🏻