Alpine images error on default entrypoint due to missing rlwrap
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:
- install rlwrap (kind of heavy for alpine)
- wait for #230 to be ready and merged
- switch to
clojureas the entrypoint for alpine images.
Would it make more sense for the default to be a shell prompt
-
clojureandcljprovide a minimal repl UI - typing clojure code in a minimal repl ui within a docker container prompt seem very limited, especially compared to an editor connected REPL workflow
- if running a repl process has the most value as the default entry point, then wouldn't it be even more valuable to include an nrepl server yo connect a local rdiyor
- leiningen and Clojure CLI are both included in the default images, so having a shell (bash) prompt seems to be more appropriate
- using clojure or clj in tool specific images means there is a different entrypoint and behaviour to the default image (assuming the above point holds true)
-
clojureandcljare typically used with aliases during development and there are a range of (for production the most common approach is to use an uberjar with the Java command)
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?
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.
OK now that #240 has landed I'm working on this.
- The fix for this is simple; we just start installing rlwrap in alpine tools-deps variants again. That's in #253.
- The way the ENTRYPOINT works in here is (was?) the recommended approach for Docker Official Images. I've been trying to track down the docs on it, but can't find them now. Or if I discover that the recommendation has changed, I'll update it.
Here are the docs I was trying to find: https://github.com/docker-library/official-images#consistency
This is why our ENTRYPOINTs and CMDs work the way they do.