This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-10
Channels
- # announcements (1)
- # babashka (178)
- # beginners (216)
- # bootstrapped-cljs (1)
- # brompton (5)
- # calva (3)
- # chlorine-clover (1)
- # clj-kondo (2)
- # cljdoc (37)
- # cljfx (4)
- # cljs-dev (2)
- # clojure (360)
- # clojure-chile (8)
- # clojure-europe (3)
- # clojure-italy (5)
- # clojure-nl (9)
- # clojure-spec (2)
- # clojure-sweden (1)
- # clojure-uk (61)
- # clojuredesign-podcast (1)
- # clojurescript (83)
- # clr (2)
- # conjure (4)
- # core-async (14)
- # cursive (20)
- # data-science (2)
- # datomic (15)
- # docker (11)
- # emotion-cljs (1)
- # figwheel-main (28)
- # find-my-lib (1)
- # fulcro (46)
- # helix (16)
- # honeysql (14)
- # jobs (10)
- # jobs-discuss (17)
- # joker (1)
- # juxt (9)
- # kaocha (8)
- # leiningen (3)
- # meander (3)
- # news-and-articles (1)
- # off-topic (110)
- # pathom (7)
- # pedestal (4)
- # protojure (2)
- # re-frame (12)
- # reagent (25)
- # ring (4)
- # shadow-cljs (109)
- # spacemacs (9)
- # specter (1)
- # sql (3)
- # tools-deps (23)
heya, how would i exec a command in container and attach stdin/stdout/stderr/tty?
seems like executing a command and getting streams is bit more complicated than i expected. lol
hey @U011YV400HX unfortunately that would be the way to interact with the container (which is a process) at least from the JVM. Its the same as using the java Process API: https://www.baeldung.com/java-process-api we need to use streams as they provide bidirectional I/O and the ability to build async things on top. This incidentally is the same way a terminal works too when you exec into a container. I hope that addresses some of your doubts?
also did you figure out how to do the exec?
honestly i got :ExecStart working
i used :as :socket
yeah so basically you need to create an exec instance and the call start on it. the exec instance op should return you a stream depending on which of streams you attached to https://docs.docker.com/engine/api/v1.40/#operation/ContainerExec
you can use :as :stream too
this conversation may help https://clojurians-log.clojureverse.org/docker/2020-05-29
stream is not bidirectional though
yeah would need a socket then.