Fork me on GitHub
Ian Fernandez03:11:55

Why when I run lein inside a dockerfile it does not fetch the dependencies?

Ian Fernandez03:11:16

{:exit 1, :out "Error encountered performing task 'run' with profile(s): 'base,system,user,provided,dev,test'\n", :err "Retrieving jonase/eastwood/0.7.1/eastwood-0.7.1.pom from clojars\nRetrieving org/clojars/brenton/google-diff-match-patch/0.1/google-diff-match-patch-0.1.pom from clojars\nRetrieving org/ow2/asm/asm-all/5.2/asm-all-5.2.pom from central\nRetrieving org/ow2/asm/asm-parent/5.2/asm-parent-5.2.pom from central\nRetrieving org/ow2/ow2/1.3/ow2-1.3.pom from central\nRetrieving lein-shadow/lein-shadow/0.3.1/lein-shadow-0.3.1.pom ,,,,, 

Ian Fernandez12:11:22

this was a problem of r/w permissions on dockerfile.

Ian Fernandez03:11:03 /app/target/classes/META-INF/maven/my-package/my-package/ (Read-only file system) at java.base/ Method)

Ian Fernandez03:11:16

it's breaking on this error

Linus Ericsson09:11:53

How does your Dockerfile look? It seems like it's using the .m2 in the system or something like that, and that may be read only "(Read-only file system)" which makes it impossible for lein to save the dependencies.


Can I override some setting from project.clj via command line? Specifically, I want to run lein eftest with :eftest {:multithread? true} while project.clj contains :eftest {:multithread? false}


there's lein update-in


Perfect, thanks!

Ian Fernandez12:11:43

how can I build a cache for leiningen deps on a docker container?


What's worked best for me is building an "uberjar" containing all my deps outside docker, then putting that jar inside the container once it is constructed. This leads to better start up time, and reduced RAM usage, and you can use that ubarjar to eg. start a repl or a secondary entry point by using the -cp arg to java to specify the jar as the classpath, then using clojure.main as entrypoint, pointing it to the namespace you want to run.

clojure-spin 1