 
 (defn delete-instances [instances]
   (doseq [i instances]
-    (let [{host :host, id :id} i
-          cli (docker/make-client (str (urly/host-of (urly/url-like host)) ":4243"))]
+    (let [{:keys [docker-host id]} i
+          cli (docker/make-client docker-host)]
       (container/stop cli id)
       (container/remove cli id))))
 

(defn- pick-backends
  "Randomly choose docker backend"
  [n]
  (mapv (fn [ip] {:client (docker/make-client (str ip ":2375"))
                  :port   (router/generate-host-port ip)})
        (->> (clusters/docker-hosts)
             shuffle
             (take n))))

               :cmd command
               :port-bindings {host-port port})
          upstream (upstream-url cli host-port)]
      {:id id, :docker-host (.host cli), :host upstream})))

(defn create [app-name user image & {:keys [tag command port ps]}]
  (let [ps (or ps 1)
