        (docker spec [])
        (throw (new IllegalArgumentException reason)))))
   ([[instruction args & rest] m]
-   (let [m (build instruction args m)]
+   (let [m (build-instruction instruction args m)]
      (if (seq rest)
        (docker rest m) m))))
 

   " "
   (s/join " " v)))

(defn resolve-args [args]
  (cond
    (vector? args) args
    (seq? args) (vec args)
    (function? args) (args)
    :else [args]))

(defn- build-instruction [instruction args]
  (if (contains? INSTRUCTIONS instruction)
    (instruction-concat instruction (resolve-args args))
    ""))

(defn- build [instruction args m]
  (let [result (build-instruction instruction args)]
    (if (empty? result)
      m
      (conj m result))))

(defn validate [[first & rest :as spec]]
  (cond

(ns cljocker.hh.dsl.docker
  (:refer-clojure :exclude [resolve])
  (:require [clojure.string :as s]
            [clojure.test :refer :all]
            [clojure.set :refer :all]))
