This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-03
Channels
- # announcements (1)
- # babashka (31)
- # babashka-sci-dev (53)
- # beginners (33)
- # calva (54)
- # cider (15)
- # clj-kondo (9)
- # clojure (115)
- # clojure-dev (19)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (78)
- # clojurescript (10)
- # clr (9)
- # community-development (9)
- # core-async (24)
- # cursive (18)
- # datomic (59)
- # emacs (43)
- # figwheel-main (2)
- # fulcro (4)
- # graphql (4)
- # malli (7)
- # meander (12)
- # nbb (14)
- # off-topic (22)
- # polylith (8)
- # re-frame (5)
- # reitit (3)
- # releases (1)
- # shadow-cljs (36)
- # sql (1)
- # tools-build (23)
- # xtdb (13)
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?
Also not sure if this is the best channel for this 😬
there is a docker image that http://docker.com 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
noted, I guess I should say that is the one that is marked "Docker official image" https://hub.docker.com/_/clojure
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
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
That's this version https://github.com/Quantisan/docker-clojure/blob/08479c1b00c308743a360a79a82338fa04e59a9a/target/eclipse-temurin-19-jdk-jammy/tools-deps/Dockerfile with the 1.11.1.1208 CLI
☝️: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)
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
Build succeeds, I watch my deps and the tools.build deps get pulled
But docker run fails
(~/.clojure)-(!2179)-> docker run clojure:temurin-19-tools-deps --version
Clojure CLI version 1.11.1.1165
Thu Feb 02 16:47:54
(~/.clojure)-(!2180)-> docker run clojure:temurin-19-tools-deps -M -e "(clojure-version)"
"1.11.1"
(but surprised I didn't get 1.11.1.1208 there but it's still a recent version)
Oh, I had that version locally...
(~/.clojure)-(!2181)-> docker run clojure:temurin-19-tools-deps-1.11.1.1208 --version
Unable to find image 'clojure:temurin-19-tools-deps-1.11.1.1208' locally
temurin-19-tools-deps-1.11.1.1208: Pulling from library/clojure
10ac4908093d: Pull complete
...
da31c64a0382: Pull complete
Digest: sha256:88651758a515994b9be316e7a32a2f40db7551f8f0b4949628c9cd2752578869
Status: Downloaded newer image for clojure:temurin-19-tools-deps-1.11.1.1208
Clojure CLI version 1.11.1.1208
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 https://practical.li/blog/posts/build-and-run-clojure-with-multistage-dockerfile/ • I should update this article for tools.build, 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