Fork me on GitHub
Ben Lieberman00:02:48

I don't really know anything about Docker but I've built an image and I have the run cmd set to clojure -Sdeps '{:deps {my/jar ...}}' but it returns this error "Invalid option -Sdeps". I'm using the official Clojure image from Docker Hub so I would think all the normal CLI options would work?

Ben Lieberman00:02:44

Also not sure if this is the best channel for this 😬


there is no "official" clojure docker


as in there is none thatis "blessed" by the clojure core team (I don't think)


there is a docker image that has decided is "official" and who knows what is in it, and who knows if anyone that has written a clojure program was involved in creating it

Ben Lieberman00:02:58

noted, I guess I should say that is the one that is marked "Docker official image"


debian at one point packaged its own shell scripts with clojure, so if you apt-get installed clojure you would get a shell script called clojure that would launch a clojure repl and not much else


sounds like that is what you are getting

Ben Lieberman00:02:14

hm, that sounds promising, because I don't have any explicit "download Clojure" commands in my Dockerfile (should I?). I figured that the image would be doing that for me :man-shrugging::skin-tone-2:


Oh, it probably has only lein by default (and some ancient default version of clojure?). You need one of the tools-deps from that page.


e.g., clojure:temurin-19-tools-deps


☝️:skin-tone-2: That help @U03QBKTVA0N?


(we use that image at work for our BitBucket CI but I've never paid attention to the installed CLI version because we have our own version, vendored into our repo, and that is what gets used for our CI pipeline)

Ben Lieberman00:02:50

I was reading these docs and others, and I tried doing FROM clojure:tools-deps and other variants thereof but it did not make a difference

Ben Lieberman00:02:12

Build succeeds, I watch my deps and the deps get pulled

Ben Lieberman00:02:16

But docker run fails


(~/.clojure)-(!2179)-> docker run clojure:temurin-19-tools-deps --version
Clojure CLI version

Thu Feb 02 16:47:54
(~/.clojure)-(!2180)-> docker run clojure:temurin-19-tools-deps -M -e "(clojure-version)"


(but surprised I didn't get there but it's still a recent version)


Oh, I had that version locally...

(~/.clojure)-(!2181)-> docker run clojure:temurin-19-tools-deps- --version
Unable to find image 'clojure:temurin-19-tools-deps-' locally
temurin-19-tools-deps- Pulling from library/clojure
10ac4908093d: Pull complete
da31c64a0382: Pull complete
Digest: sha256:88651758a515994b9be316e7a32a2f40db7551f8f0b4949628c9cd2752578869
Status: Downloaded newer image for clojure:temurin-19-tools-deps-
Clojure CLI version

Ben Lieberman00:02:18

I'll have to consult this more closely when I'm back home. Thanks @U04V70XH6


The Official Clojure docker image is excellent (very surprised at the negative comments in this thread) It supports the latest released version of Clojure CLI and Leiningen (even boot) I used the Official Clojure docker image in my last two commercial projects without issue. I use a multi-stage Docker config, one stage to build, one to run • I should update this article for, but it's just changing one line, the command that builds to uberjar


FYI there is a #C0PME9N9X channel if you don't get help here