   []
   {:Image "edpaget/lein"
    :Tty true
+   :Memory "256M"
    :Cmd ["/opt/lein" "repl" ":headless" ":host" "0.0.0.0" ":port" "8081"]})
 
 (defn- start-docker

      (if (re-find nrepl-sentinel msg)
        (do
          (log/info (str "Connecting to docker nrepl at" ip ":" port))
          (>! out-chan "REPL OK")
          (go-loop [repl-conn (repl/connect :host ip :port port)
                    client (repl/client repl-conn 1000)
                    command (<! in-chan)]
            (->> (repl/message client {:op :eval :code command})
                 repl/response-values
                 prn-str
                 (>! out-chan)))
          (recur repl-conn (<! in-chan) client))
        (do (>! out-chan msg)
            (recur (<! stdout)))))
    [id http-client]))


  [client id]
  (container/stop client id))

(defn- vectorize
  [msg]
  (pr-str (vector msg)))

(defn- docker-repl
  [client in-chan out-chan]
  (let [[id [stdout http-client]] (start-docker client)
