Fork me on GitHub
#docker
<
2018-03-05
>
felipebarros20:03:43

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.

gonewest81820:03:53

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.

gonewest81820:03:10

Installing clojure:

$ docker run -it clojure
[email protected]:/tmp# curl -O 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1812  100  1812    0     0   5176      0 --:--:-- --:--:-- --:--:--  5177
[email protected]:/tmp# chmod +x linux-install-1.9.0.358.sh
[email protected]:/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.
[email protected]:/tmp# clj
Please install rlwrap for command editing or use "clojure" instead.
[email protected]:/tmp# clojure
Clojure 1.9.0
user=> 

felipebarros20:03:47

Weird, here it is pulling 1.8

gonewest81820:03:45

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.

felipebarros20:03:13

Oh, sorry, missed that. Well, thanks!