This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-05
Channels
- # announcements (1)
- # babashka (61)
- # babashka-sci-dev (1)
- # beginners (54)
- # biff (17)
- # cider (4)
- # circleci (1)
- # clj-commons (39)
- # clj-kondo (26)
- # cljdoc (40)
- # clojure (41)
- # clojure-europe (32)
- # clojure-norway (4)
- # clojure-portugal (1)
- # clojure-uk (2)
- # clojurescript (59)
- # clr (69)
- # conjure (7)
- # cursive (22)
- # data-science (16)
- # datalevin (1)
- # datomic (19)
- # docker (31)
- # funcool (1)
- # honeysql (6)
- # hoplon (1)
- # hyperfiddle (41)
- # introduce-yourself (1)
- # juxt (2)
- # leiningen (5)
- # nbb (14)
- # nextjournal (38)
- # off-topic (47)
- # polylith (2)
- # rdf (5)
- # re-frame (4)
- # reitit (27)
- # releases (6)
- # scittle (10)
- # shadow-cljs (24)
- # sql (11)
- # squint (1)
- # tools-build (33)
- # tree-sitter (4)
- # vim (39)
Hello! I have a bit of a strange question. I have a Dockerfile that starts with FROM databricks/minimal:experimental
that includes installs of R and RStudio and a bunch of other things. I'd like to add a Clojure install as well. I've read that some people use multiple FROM
statements, but curious what is the preferred method to include Clojure in a such Dockerfile
?
That's the only way to do it - your Dockerfile will define a new image that will be derived from the image coming FROM ...
I'm a Docker beginner, does it matter which FROM...
occurs first? Any relevant doc links much appreciated. Thank-you
I see - you'd like to merge images or something like that? That's not something you can do - I'd probably do something like this:
FROM databricks/minimal:experimental
RUN .... install clojure using one of these : - it will depend on the OS of the base image
no you most likely won't, but if you figure out what is the underlying distribution you can install Java and other necessary bits to run the clojure installer
this might work docker run --rm -it databricks/minimal:experimental uname -a
or lsb_release
the underlying distro will be something I choose. Probably 10.4-LTS or an LTS more recent
That's not how Docker images work - you either start with your own base image and install whatever you need into it. Or you pick a base image which bundles some stuff already (R in your case) and then you add on top of it. You cannot really merge images using multiple FROM
statements - at best you can copy files between different layers, but that's about it - so you can't pick your own base image that way
yeah - definitely not asking for trouble 😉 Something easy, solid, and painless is my preference, lol.
Maybe you find some 'datascience' Docker image containing R plus java. Or even Clojure
That would be ideal. In my case, it would actually need to include databricksruntime/rbase
(https://github.com/databricks/containers/blob/master/ubuntu/R/Dockerfile) plus Java and Clojure (maybe a few other things too)
not sure how to search for such a thing. Is this what you were thinking @U7CAHM72M? https://hub.docker.com/search?q=r+openjdk
this is promising:
# Example
FROM <base image>
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
from https://hub.docker.com/_/eclipse-temurinYour example is using a multi-stage Dockerfile. I am not sure, if this feature of Docker supports all scenarios of 'merge'
it would be amazing to also have libpython-clj like you say. How can I peruse the Dockerfile?
The Dockerfile is here: https://github.com/behrica/clj-py-r-template/blob/master/docker-base/Dockerfile

You can take and adapt it to your needs. Or copy pieces into any other Dockerfike. Of course , the instructions are working in certain base images / OS only
Man, I've done something like this before... IIRC I just needed to copy two things from the tools-deps clojure image and then I had a working clojure tools.deps system. I think I did it in a GraalVM project. Let me see if I can dig it up.
yeah here it is: https://github.com/fluree/flurl/blob/a95b106840fa8d8f294c337307767b7dc917532b/Dockerfile.build#L8-L9
along with that first FROM line that ends in AS clojure
Just lately learned you can copy things from one image to another. Might be helpful in reducing steps for some combined images. https://twitter.com/settermjd/status/1542086472647331840?t=Yn76fwny_wegMRTGNPCp2g&s=09