Quantisan / docker-clojure

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

Alpine images error on default entrypoint due to missing rlwrap #241

Open cap10morgan opened 1 month ago

cap10morgan commented 1 month ago

Due to #23

docker run clojure:tools-deps-alpine =>

/usr/local/bin/rlwrap: line 13: /usr/bin/rlwrap: not found

Could do any one of the following:

practicalli-johnny commented 1 month ago

Would it make more sense for the default to be a shell prompt

There are many options even using clojure or clj as the default, so would using a shell prompt as the default be more flexible and simpler approach for all Clojure images?

alexander-yakushev commented 1 month ago

I agree with you on most or ever all points. However, the current entrypoint also allows executing Leiningen and tools.deps subcommands, e.g.:

$ docker run --rm -ti clojure:temurin-22-lein-2.11.2-jammy help
Leiningen is a tool for working with Clojure projects.

Several tasks are available:
change              Rewrite project.clj with f applied to the value at key-or-path.
check               Check syntax and warn on reflection.
classpath           Write the classpath of the current project to output-file.
clean               Removes all files from paths in clean-targets for a project
compile             Compile Clojure source into .class files.
...

Somebody might be reliant on this behavior, so I guess we are kinda stuck with supporting this (if compatibility is a priority). I'm not a fan of this approach either but it is what it is.

We can, theoretically, keep this behavior but change the default command from say lein repl to bash if no arguments are provided to the docker run command. It's just that the entrypoint script is already pretty complicated, I'm not sure if adding more complexity to it is a good thing.