This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-17
Channels
- # announcements (17)
- # aws (2)
- # babashka (21)
- # beginners (67)
- # calva (19)
- # cider (29)
- # clara (3)
- # clj-kondo (6)
- # cljsrn (10)
- # clojure (140)
- # clojure-europe (164)
- # clojure-nl (3)
- # clojure-uk (8)
- # clojurescript (62)
- # conjure (7)
- # core-async (24)
- # cursive (21)
- # datomic (5)
- # docker (40)
- # emacs (14)
- # fulcro (25)
- # gratitude (1)
- # honeysql (6)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (32)
- # juxt (7)
- # lsp (13)
- # minecraft (2)
- # off-topic (49)
- # pathom (24)
- # practicalli (8)
- # re-frame (18)
- # react (23)
- # remote-jobs (6)
- # reveal (2)
- # shadow-cljs (75)
- # tools-deps (7)
I use the docker pod like this:
(require '[babashka.pods :as pods])
(require '[clojure.java.shell :refer [sh]])
(require '(clojure.java [io :as io]))
(pods/load-pod 'lispyclouds/docker "0.1.1")
(require '[pod.lispyclouds.docker :as docker])
(def images (docker/client {:category :images
:conn {:uri "unix:///var/run/docker.sock"}}))
(shell/sh "tar cf /tmp/context.tar .")
(def is (io/input-stream "/tmp/context.tar"))
(docker/invoke images {:op :ImageBuild
:inputStream is
:dockerfile "Dockerfile"})
To do adocker build .
But I get a error message which I don't understand, and seem to be related to babashka
clojure.lang.ExceptionInfo: No reader function for tag object
{:type :sci/error, :line 1, :column 1, :message "No reader function for tag object", :sci.impl/callstack #object[clojure.lang.Delay 0x5b73dbd7 {:status :pending, :val nil}], :file "/home/carsten/Dropbox/sources/scicloj-tooling/zero-to-interop.bb", :locals {}}
at sci.impl.utils$rethrow_with_location_of_node.invokeStatic (utils.cljc:71)
sci.impl.evaluator$eval.invokeStatic (evaluator.cljc:329)
sci.impl.interpreter$eval_form.invokeStatic (interpreter.cljc:78)
sci.core$eval_form.invokeStatic (core.cljc:270)
babashka.nrepl.impl.server$eval_msg$fn__34566$fn__34567.invoke (server.clj:61)
babashka.nrepl.impl.server$eval_msg$fn__34566.invoke (server.clj:57)
babashka.nrepl.impl.server$eval_msg.invokeStatic (server.clj:47)
babashka.nrepl.impl.server$session_loop.invokeStatic (server.clj:242)
babashka.nrepl.impl.server$listen$fn__34639.invoke (server.clj:283)
sci.impl.vars$binding_conveyor_fn$fn__700.invoke (vars.cljc:154)
clojure.core$binding_conveyor_fn$fn__5773.invoke (core.clj:2034)
@U7CAHM72M Ah I see. You cannot push the input stream over the wire to the pod function call. Pod functions work via RPC and you can't serialize an inputstream via edn or transit
Perhaps @rahul080327, the author of this pod, knows a better alternative
This unfortunately is a requirement of the docker API and hence the lib that i wrote too. Probably in this case its better to shell out to the docker cli and do the build as i can see the docker daemon locally running
@rahul080327 you could serialize the :inputstream argument to a byte array though and then make it an inputsteam again on the pod side. This is just work that comes with pod making.
yeah i can think about it sometime soon, probably can use the newer lib for the pod
new pod in fact
This needs to be shared here. Calling native libraries from bb: https://github.com/babashka/babashka/discussions/1011 /cc @suskeyhose @rahul080327
is libffi a graal library?
It's a c library https://github.com/libffi/libffi
graalvm has a c ffi, but you can't load and call c libraries dynamically, https://www.graalvm.org/reference-manual/native-image/C-API/
ah, I see. that makes sense.