leiningen

Linus Ericsson 2021-11-12T09:43:53.025900Z

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.

jumar 2021-11-12T10:52:11.027300Z

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}

vemv 2021-11-12T11:13:15.027400Z

there's lein update-in

jumar 2021-11-12T17:11:43.028500Z

Perfect, thanks!

2021-11-12T12:51:43.028300Z

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

2021-12-02T19:19:36.036300Z

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.

1
2021-11-12T03:12:55.022600Z

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

2021-11-12T03:13:16.023Z

{: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 ,,,,, 

2021-11-12T12:51:22.027600Z

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

2021-11-12T03:13:24.023200Z

like this?

2021-11-12T03:16:03.023800Z

java.io.FileNotFoundException: /app/target/classes/META-INF/maven/my-package/my-package/pom.properties (Read-only file system) at java.base/java.io.FileOutputStream.open0(Native Method)

2021-11-12T03:16:16.024200Z

it's breaking on this error