I'm trying to run the clj
cli tool using the official image with docker run -it clojure clj
but it doesn't seem to work. I'm really confused with this new tools and how they interact with lein or boot and would like to try my hand at it. What would be the elegant way to play with it using Docker and the official images? Thanks.
It appears the official image doesn’t include clj
. That’s why docker run -it clojure clj
fails. Your two options are to install it, or use Leiningen which is already there.
Installing clojure:
$ docker run -it clojure
root@842d6cdb09d3:/tmp# curl -O <https://download.clojure.org/install/linux-install-1.9.0.358.sh>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1812 100 1812 0 0 5176 0 --:--:-- --:--:-- --:--:-- 5177
root@842d6cdb09d3:/tmp# chmod +x linux-install-1.9.0.358.sh
root@842d6cdb09d3:/tmp# ./linux-install-1.9.0.358.sh
Downloading and expanding tar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17.2M 100 17.2M 0 0 3158k 0 0:00:05 0:00:05 --:--:-- 2798k
Installing libs into /usr/local/lib/clojure
Installing clojure and clj into /usr/local/bin
Installing man pages into /usr/local/share/man/man1
Removing download
Use clj -h for help.
root@842d6cdb09d3:/tmp# clj
Please install rlwrap for command editing or use "clojure" instead.
root@842d6cdb09d3:/tmp# clojure
Clojure 1.9.0
user=>
Weird, here it is pulling 1.8
I would have thought the argument to curl, which in my case was “https://download.clojure.org/install/linux-install-1.9.0.358.sh” would be the thing.
Oh, sorry, missed that. Well, thanks!