          "WORKDIR /tmp"
          ""
          "# Download the whole repo as an archive"
-         "RUN \\"]
+         "RUN set -eux; \\"]
         (concat-commands install-dep-cmds)
         (concat-commands
           ["mkdir -p $LEIN_INSTALL"

(ns docker-clojure.dockerfile.lein
  (:require [clojure.string :as str]
            [docker-clojure.dockerfile.shared :refer :all]))

(def distro-deps
  {:debian-slim {:build   #{"wget" "gnupg"}

           (str "echo \"" (get-in installer-hashes ["lein" build-tool-version]) " *lein-pkg\" | sha256sum -c -")
           "mv lein-pkg $LEIN_INSTALL/lein"
           "chmod 0755 $LEIN_INSTALL/lein"
           "export GNUPGHOME=\"$(mktemp -d)\""
           "export FILENAME_EXT=jar"
           "if printf '%s\\n%s\\n' \"2.9.7\" \"$LEIN_VERSION\" | sort -cV; then \\
              gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED; \\
            else \\
              gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 20242BACBBE95ADA22D0AFD7808A33D379C806C3; \\
              FILENAME_EXT=zip; \\
           fi"
           "wget -q https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT"
           "wget -q https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc"
           "echo \"Verifying file PGP signature...\""
           "gpg --batch --verify leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT"
           "gpgconf --kill all"
           "rm -r \"$GNUPGHOME\" leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc"
           "mkdir -p /usr/share/java"
           "mv leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar"]
          (empty? uninstall-dep-cmds))
        (concat-commands uninstall-dep-cmds :end)
        (concat
