From 9b70b46d2bc83c159bc95a7de0e7e6a9fd0a1af5 Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Thu, 21 Sep 2023 13:59:37 -0600 Subject: [PATCH 1/6] Move arg vectors to their own lines --- src/docker_clojure/core.clj | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/docker_clojure/core.clj b/src/docker_clojure/core.clj index 0410cffe..33ecae3a 100644 --- a/src/docker_clojure/core.clj +++ b/src/docker_clojure/core.clj @@ -24,7 +24,8 @@ (= v (get haystack k))) needles)) -(defn base-image-tag [base-image jdk-version distro] +(defn base-image-tag + [base-image jdk-version distro] (str base-image ":" (case base-image "eclipse-temurin" (str jdk-version "-jdk-") @@ -44,7 +45,8 @@ ::cfg/maintainer ::cfg/docker-tag] :opt-un [::cfg/build-tool-versions ::cfg/architectures])) -(defn assoc-if [m pred k v] +(defn assoc-if + [m pred k v] (if (pred) (assoc m k v) m)) @@ -118,7 +120,8 @@ (get-or-default cfg/default-distros cfg/default-jdk-version) [::all])) -(defn image-variant-combinations [base-images jdk-versions distros build-tools] +(defn image-variant-combinations + [base-images jdk-versions distros build-tools] (reduce (fn [variants jdk-version] (concat @@ -136,7 +139,8 @@ acc')))))) #{} jdk-versions)) -(defn image-variants [base-images jdk-versions distros build-tools] +(defn image-variants + [base-images jdk-versions distros build-tools] (into #{} (comp (map variant-map) @@ -153,7 +157,8 @@ (Thread/sleep rand-time) (apply f args))) -(defn build-images [parallelization installer-hashes variants] +(defn build-images + [parallelization installer-hashes variants] (log "Building images" parallelization "at a time") (let [variants-ch (to-chan! variants) builds-ch (chan parallelization)] From ab130e4fd1ae7305987d4e6df2a4feaed03731af Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Thu, 12 Oct 2023 08:19:03 -0600 Subject: [PATCH 2/6] Add JDK 21 to build matrix & make it the new default --- src/docker_clojure/config.clj | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/docker_clojure/config.clj b/src/docker_clojure/config.clj index b7b8923a..1e56d91b 100644 --- a/src/docker_clojure/config.clj +++ b/src/docker_clojure/config.clj @@ -39,14 +39,14 @@ (def git-repo "https://github.com/Quantisan/docker-clojure.git") -(def jdk-versions #{8 11 17 20}) +(def jdk-versions #{8 11 17 20 21}) (def base-images "Map of JDK version to base image name(s) with :default as a fallback" {:default ["eclipse-temurin" "debian"]}) ;; The default JDK version to use for tags that don't specify one; usually the latest LTS release -(def default-jdk-version 17) +(def default-jdk-version 21) (def distros "Map of base image name to set of distro tags to use, namespaced by Linux @@ -86,12 +86,21 @@ ; download boot as of 2022-11-17. Probably would deprecate one or both of ; JDK 8 and/or boot variants before spending much time working around an ; issue like this. + + ; no more focal builds for JDK 20+ + ; TODO: Add ability to specify version >= 20 for these {:jdk-version 20 - :distro :ubuntu/focal} ; no more focal builds for JDK 20+ + :distro :ubuntu/focal} + {:jdk-version 21 + :distro :ubuntu/focal} {:build-tool "boot" :distro :alpine/alpine} ; boot is breaking on Alpine + ; we're no longer building boot variants for JDK 20+ + ; TODO: Add ability to specify version >= 20 for these {:jdk-version 20 - :build-tool "boot"} ; we're no longer building boot variants for JDK 20+ + :build-tool "boot"} + {:jdk-version 21 + :build-tool "boot"} ;; commented out example #_{:jdk-version 8 :distro :alpine/alpine}}) From dc5eb649a0b97bac5ff3249abdb3da13c22ce33c Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Thu, 12 Oct 2023 09:32:15 -0600 Subject: [PATCH 3/6] Use Debian bookworm as default distro for JDK 21+ ...and bookworm as a new variant option across all other combinations --- src/docker_clojure/config.clj | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/docker_clojure/config.clj b/src/docker_clojure/config.clj index 1e56d91b..a47de5c5 100644 --- a/src/docker_clojure/config.clj +++ b/src/docker_clojure/config.clj @@ -43,7 +43,11 @@ (def base-images "Map of JDK version to base image name(s) with :default as a fallback" - {:default ["eclipse-temurin" "debian"]}) + {8 ["eclipse-temurin" "debian"] + 11 ["eclipse-temurin" "debian"] + 17 ["eclipse-temurin" "debian"] + 20 ["eclipse-temurin" "debian"] + :default ["debian" "eclipse-temurin"]}) ;; The default JDK version to use for tags that don't specify one; usually the latest LTS release (def default-jdk-version 21) @@ -52,7 +56,8 @@ "Map of base image name to set of distro tags to use, namespaced by Linux distro type. :default key is a fallback for base images not o/w specified." {:default #{:alpine/alpine :ubuntu/focal :ubuntu/jammy} - "debian" #{:debian-slim/bullseye-slim :debian/bullseye}}) + "debian" #{:debian-slim/bookworm-slim :debian/bookworm + :debian-slim/bullseye-slim :debian/bullseye}}) (def default-architectures #{"amd64" "arm64v8"}) @@ -65,7 +70,11 @@ (def default-distros "The default distro to use for tags that don't specify one, keyed by jdk-version. :default is a fallback for jdk versions not o/w specified." - {:default :ubuntu/jammy}) + {8 :ubuntu/jammy + 11 :ubuntu/jammy + 17 :ubuntu/jammy + 20 :ubuntu/jammy + :default :debian/bookworm}) (def build-tools {"lein" "2.10.0" From ae50a7fd92b1b077ca9f05bbb50bae9a170f5c47 Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Thu, 12 Oct 2023 09:32:27 -0600 Subject: [PATCH 4/6] Update README for JDK 21 changes --- README.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4ad42673..18f07f63 100644 --- a/README.md +++ b/README.md @@ -41,15 +41,15 @@ by this change. ## JDK versions Java follows a release cadence of every 6 months with an LTS (long-term support) -release every 3 years. As of 2019-9-25, our images will default to the latest -LTS release of OpenJDK (currently 17). But we also now provide the ability to +release every 2-3 years. As of 2019-9-25, our images will default to the latest +LTS release of OpenJDK (currently 21). But we also now provide the ability to specify which version of Java you'd like via Docker tags: JDK 1.8 tools-deps image: `clojure:temurin-8-tools-deps` JDK 11 variant of the tools-deps image: `clojure:temurin-11-tools-deps` or `clojure:temurin-11` -JDK 17 variant of the tools-deps image: `clojure:tools-deps` or `clojure:temurin-17` or `clojure:temurin-17-tools-deps` JDK 17 with boot 2.8.3: `clojure:temurin-17-boot-2.8.3` JDK 20 with the latest version of lein: `clojure:temurin-20-lein` +JDK 21 variant of the tools-deps image: `clojure:tools-deps` or `clojure:temurin-21` or `clojure:temurin-21-tools-deps` ## Linux distro @@ -64,10 +64,19 @@ want a different base image than what they provide). It is recommended to use the Debian variants unless you have a need to use Ubuntu or stick closer to the official upstream images. -As of 2022-9-29 the default distro is Ubuntu jammy in order to maintain -backwards compatibility. But you should not interpret this default as a -recommendation. Use Debian bullseye or bullseye-slim variants unless you have -a good, specific reason not to. There are fewer dead ends that way. +As of 2023-10-12 the default distro is Debian bookworm (12) in JDK 21+ images +and Ubuntu jammy (22.04) in JDK <=20 images in order to maintain backwards +compatibility. But we recommend you use Debian variants on any JDK version +unless you have a good, specific reason not to. There are fewer dead ends that +way. + +### debian-slim + +For a lighter-weight image, try the Debian `-slim` variants. You can just put +`bookworm-slim` (for Debian 12) or `bullseye-slim` (for Debian 11) in the distro +slot of your Docker tag to get those. + +### Examples You can specify which distro & version you'd like by appending it to the end of your Docker tag as in the following examples (but note that not every @@ -77,6 +86,7 @@ Java 8 leiningen on Debian bullseye-slim: `clojure:temurin-8-lein-bullseye-slim` Java 11 leiningen on Debian bullseye: `clojure:temurin-11-lein-bullseye` Java 17 tools-deps on Ubuntu focal: `clojure:tools-deps` or `clojure:temurin-17` or `clojure:temurin-17-tools-deps` or `clojure:temurin-17-tools-deps-focal` Java 17 tools-deps on Debian bullseye-slim: `clojure:bullseye-slim` or `clojure:tools-deps-bullseye-slim` or `clojure:temurin-17-bullseye-slim` or `clojure:temurin-17-tools-deps-bullseye-slim` +Java 21 tools-deps on Debian bookworm: `clojure:tools-deps` or `clojure:temurin-21-tools-deps` or `clojure:temurin-21-bookworm` ### Alpine Linux @@ -89,15 +99,6 @@ Some example tags: Java 17 leiningen on Alpine: `clojure:temurin-17-alpine` `clojure:temurin-17-lein-alpine` Java 20 tools-deps on Alpine: `clojure:temurin-20-tools-deps-alpine` or `clojure:temurin-20-alpine` -### `clojure:slim-buster` / `clojure:slim-bullseye` - -These images are based on the Debian buster distribution but have fewer -packages installed and are thus a bit smaller than the `buster` or `bullseye` -images. Their use is recommended. - -Note that as of 2022-9-29 there are no `slim-focal` images published by the -eclipse-temurin maintainers, so the slim option there is the `alpine` variant. - ## Examples ### Interactive Shell From 3f1ce71ed8fc2ee53c9170dd9dd90894281b5a23 Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Thu, 12 Oct 2023 09:32:52 -0600 Subject: [PATCH 5/6] Update manifest tests for JDK 21 changes TODO: Make these less dependent on defaults --- test/docker_clojure/manifest_test.clj | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/docker_clojure/manifest_test.clj b/test/docker_clojure/manifest_test.clj index dbf1d8d6..485b0f65 100644 --- a/test/docker_clojure/manifest_test.clj +++ b/test/docker_clojure/manifest_test.clj @@ -4,9 +4,9 @@ (deftest variant-tags-test (testing "Generates all-defaults tag for a build tool" - (let [tags (variant-tags {:base-image "eclipse-temurin" - :jdk-version 17 - :distro :ubuntu/jammy + (let [tags (variant-tags {:base-image "debian" + :jdk-version 21 + :distro :debian/bookworm :build-tool "tools-deps" :build-tool-version "1.11.1.1155"})] (is ((set tags) "tools-deps")))) @@ -20,14 +20,16 @@ ((set tags) tag)) 11 "temurin-11-tools-deps" 17 "temurin-17-tools-deps" - 18 "temurin-18-tools-deps")) + 20 "temurin-20-tools-deps")) (testing "Generates build-tool-distro tag for every distro" (are [distro tag] - (let [tags (variant-tags {:base-image "eclipse-temurin" - :jdk-version 17 + (let [tags (variant-tags {:base-image "debian" + :jdk-version 21 :distro distro :build-tool "tools-deps" :build-tool-version "1.11.1.1155"})] ((set tags) tag)) - :ubuntu/focal "tools-deps-focal" - :ubuntu/jammy "tools-deps-jammy"))) + :debian/bullseye "tools-deps-bullseye" + :debian-slim/bullseye-slim "tools-deps-bullseye-slim" + :debian/bookworm "tools-deps-bookworm" + :debian-slim/bookworm-slim "tools-deps-bookworm-slim"))) From 4c682ece48d1d460ed695c8718599ca52ed24e00 Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Thu, 12 Oct 2023 09:33:21 -0600 Subject: [PATCH 6/6] Sync Dockerfiles w/ JDK 21 changes --- target/debian-bookworm-11/boot/Dockerfile | 33 +++++++++++++ target/debian-bookworm-11/boot/entrypoint | 21 +++++++++ target/debian-bookworm-11/lein/Dockerfile | 44 +++++++++++++++++ target/debian-bookworm-11/lein/entrypoint | 21 +++++++++ .../debian-bookworm-11/tools-deps/Dockerfile | 29 ++++++++++++ .../tools-deps}/entrypoint | 0 .../tools-deps}/rlwrap.retry | 0 target/debian-bookworm-17/boot/Dockerfile | 36 ++++++++++++++ target/debian-bookworm-17/boot/entrypoint | 21 +++++++++ target/debian-bookworm-17/lein/Dockerfile | 47 +++++++++++++++++++ target/debian-bookworm-17/lein/entrypoint | 21 +++++++++ .../debian-bookworm-17/tools-deps/Dockerfile | 32 +++++++++++++ .../debian-bookworm-17/tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ target/debian-bookworm-20/lein/Dockerfile | 47 +++++++++++++++++++ target/debian-bookworm-20/lein/entrypoint | 21 +++++++++ .../debian-bookworm-20/tools-deps/Dockerfile | 32 +++++++++++++ .../debian-bookworm-20/tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../latest/Dockerfile | 10 ++-- target/debian-bookworm-21/latest/entrypoint | 21 +++++++++ target/debian-bookworm-21/latest/rlwrap.retry | 30 ++++++++++++ target/debian-bookworm-21/lein/Dockerfile | 47 +++++++++++++++++++ target/debian-bookworm-21/lein/entrypoint | 21 +++++++++ .../debian-bookworm-21/tools-deps/Dockerfile | 32 +++++++++++++ .../debian-bookworm-21/tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ target/debian-bookworm-8/boot/Dockerfile | 33 +++++++++++++ target/debian-bookworm-8/boot/entrypoint | 21 +++++++++ target/debian-bookworm-8/lein/Dockerfile | 44 +++++++++++++++++ target/debian-bookworm-8/lein/entrypoint | 21 +++++++++ .../debian-bookworm-8/tools-deps/Dockerfile | 29 ++++++++++++ .../debian-bookworm-8/tools-deps/entrypoint | 21 +++++++++ .../debian-bookworm-8/tools-deps/rlwrap.retry | 30 ++++++++++++ .../debian-bookworm-slim-11/boot/Dockerfile | 33 +++++++++++++ .../debian-bookworm-slim-11/boot/entrypoint | 21 +++++++++ .../debian-bookworm-slim-11/lein/Dockerfile | 44 +++++++++++++++++ .../debian-bookworm-slim-11/lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 29 ++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../debian-bookworm-slim-17/boot/Dockerfile | 36 ++++++++++++++ .../debian-bookworm-slim-17/boot/entrypoint | 21 +++++++++ .../debian-bookworm-slim-17/lein/Dockerfile | 47 +++++++++++++++++++ .../debian-bookworm-slim-17/lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 32 +++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../debian-bookworm-slim-20/lein/Dockerfile | 47 +++++++++++++++++++ .../debian-bookworm-slim-20/lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 32 +++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../debian-bookworm-slim-21/lein/Dockerfile | 47 +++++++++++++++++++ .../debian-bookworm-slim-21/lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 32 +++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ target/debian-bookworm-slim-8/boot/Dockerfile | 33 +++++++++++++ target/debian-bookworm-slim-8/boot/entrypoint | 21 +++++++++ target/debian-bookworm-slim-8/lein/Dockerfile | 44 +++++++++++++++++ target/debian-bookworm-slim-8/lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 29 ++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ target/debian-bullseye-21/lein/Dockerfile | 47 +++++++++++++++++++ target/debian-bullseye-21/lein/entrypoint | 21 +++++++++ .../debian-bullseye-21/tools-deps/Dockerfile | 32 +++++++++++++ .../debian-bullseye-21/tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../debian-bullseye-slim-21/lein/Dockerfile | 47 +++++++++++++++++++ .../debian-bullseye-slim-21/lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 32 +++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../lein/Dockerfile | 41 ++++++++++++++++ .../lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 26 ++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ .../lein/Dockerfile | 43 +++++++++++++++++ .../lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 28 +++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 ++++++++++++ 85 files changed, 2407 insertions(+), 3 deletions(-) create mode 100644 target/debian-bookworm-11/boot/Dockerfile create mode 100755 target/debian-bookworm-11/boot/entrypoint create mode 100644 target/debian-bookworm-11/lein/Dockerfile create mode 100755 target/debian-bookworm-11/lein/entrypoint create mode 100644 target/debian-bookworm-11/tools-deps/Dockerfile rename target/{eclipse-temurin-17-jdk-jammy/latest => debian-bookworm-11/tools-deps}/entrypoint (100%) rename target/{eclipse-temurin-17-jdk-jammy/latest => debian-bookworm-11/tools-deps}/rlwrap.retry (100%) create mode 100644 target/debian-bookworm-17/boot/Dockerfile create mode 100755 target/debian-bookworm-17/boot/entrypoint create mode 100644 target/debian-bookworm-17/lein/Dockerfile create mode 100755 target/debian-bookworm-17/lein/entrypoint create mode 100644 target/debian-bookworm-17/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-17/tools-deps/entrypoint create mode 100755 target/debian-bookworm-17/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-20/lein/Dockerfile create mode 100755 target/debian-bookworm-20/lein/entrypoint create mode 100644 target/debian-bookworm-20/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-20/tools-deps/entrypoint create mode 100755 target/debian-bookworm-20/tools-deps/rlwrap.retry rename target/{eclipse-temurin-17-jdk-jammy => debian-bookworm-21}/latest/Dockerfile (91%) create mode 100755 target/debian-bookworm-21/latest/entrypoint create mode 100755 target/debian-bookworm-21/latest/rlwrap.retry create mode 100644 target/debian-bookworm-21/lein/Dockerfile create mode 100755 target/debian-bookworm-21/lein/entrypoint create mode 100644 target/debian-bookworm-21/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-21/tools-deps/entrypoint create mode 100755 target/debian-bookworm-21/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-8/boot/Dockerfile create mode 100755 target/debian-bookworm-8/boot/entrypoint create mode 100644 target/debian-bookworm-8/lein/Dockerfile create mode 100755 target/debian-bookworm-8/lein/entrypoint create mode 100644 target/debian-bookworm-8/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-8/tools-deps/entrypoint create mode 100755 target/debian-bookworm-8/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-slim-11/boot/Dockerfile create mode 100755 target/debian-bookworm-slim-11/boot/entrypoint create mode 100644 target/debian-bookworm-slim-11/lein/Dockerfile create mode 100755 target/debian-bookworm-slim-11/lein/entrypoint create mode 100644 target/debian-bookworm-slim-11/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-slim-11/tools-deps/entrypoint create mode 100755 target/debian-bookworm-slim-11/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-slim-17/boot/Dockerfile create mode 100755 target/debian-bookworm-slim-17/boot/entrypoint create mode 100644 target/debian-bookworm-slim-17/lein/Dockerfile create mode 100755 target/debian-bookworm-slim-17/lein/entrypoint create mode 100644 target/debian-bookworm-slim-17/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-slim-17/tools-deps/entrypoint create mode 100755 target/debian-bookworm-slim-17/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-slim-20/lein/Dockerfile create mode 100755 target/debian-bookworm-slim-20/lein/entrypoint create mode 100644 target/debian-bookworm-slim-20/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-slim-20/tools-deps/entrypoint create mode 100755 target/debian-bookworm-slim-20/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-slim-21/lein/Dockerfile create mode 100755 target/debian-bookworm-slim-21/lein/entrypoint create mode 100644 target/debian-bookworm-slim-21/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-slim-21/tools-deps/entrypoint create mode 100755 target/debian-bookworm-slim-21/tools-deps/rlwrap.retry create mode 100644 target/debian-bookworm-slim-8/boot/Dockerfile create mode 100755 target/debian-bookworm-slim-8/boot/entrypoint create mode 100644 target/debian-bookworm-slim-8/lein/Dockerfile create mode 100755 target/debian-bookworm-slim-8/lein/entrypoint create mode 100644 target/debian-bookworm-slim-8/tools-deps/Dockerfile create mode 100755 target/debian-bookworm-slim-8/tools-deps/entrypoint create mode 100755 target/debian-bookworm-slim-8/tools-deps/rlwrap.retry create mode 100644 target/debian-bullseye-21/lein/Dockerfile create mode 100755 target/debian-bullseye-21/lein/entrypoint create mode 100644 target/debian-bullseye-21/tools-deps/Dockerfile create mode 100755 target/debian-bullseye-21/tools-deps/entrypoint create mode 100755 target/debian-bullseye-21/tools-deps/rlwrap.retry create mode 100644 target/debian-bullseye-slim-21/lein/Dockerfile create mode 100755 target/debian-bullseye-slim-21/lein/entrypoint create mode 100644 target/debian-bullseye-slim-21/tools-deps/Dockerfile create mode 100755 target/debian-bullseye-slim-21/tools-deps/entrypoint create mode 100755 target/debian-bullseye-slim-21/tools-deps/rlwrap.retry create mode 100644 target/eclipse-temurin-21-jdk-alpine/lein/Dockerfile create mode 100755 target/eclipse-temurin-21-jdk-alpine/lein/entrypoint create mode 100644 target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile create mode 100755 target/eclipse-temurin-21-jdk-alpine/tools-deps/entrypoint create mode 100755 target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry create mode 100644 target/eclipse-temurin-21-jdk-jammy/lein/Dockerfile create mode 100755 target/eclipse-temurin-21-jdk-jammy/lein/entrypoint create mode 100644 target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile create mode 100755 target/eclipse-temurin-21-jdk-jammy/tools-deps/entrypoint create mode 100755 target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry diff --git a/target/debian-bookworm-11/boot/Dockerfile b/target/debian-bookworm-11/boot/Dockerfile new file mode 100644 index 00000000..a27d4ab4 --- /dev/null +++ b/target/debian-bookworm-11/boot/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV BOOT_VERSION=2.8.3 +ENV BOOT_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# NOTE: BOOT_VERSION tells the boot.sh script which version of boot to install +# on its first run. We always download the latest version of boot.sh because +# it is just the installer script. +RUN \ +apt-get update && \ +apt-get install -y make wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $BOOT_INSTALL && \ +wget -q https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && \ +echo "Comparing installer checksum..." && \ +sha256sum boot.sh && \ +echo "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3 *boot.sh" | sha256sum -c - && \ +mv boot.sh $BOOT_INSTALL/boot && \ +chmod 0755 $BOOT_INSTALL/boot && \ +apt-get purge -y --auto-remove wget + +ENV PATH=$PATH:$BOOT_INSTALL +ENV BOOT_AS_ROOT=yes + +RUN boot + +CMD ["boot", "repl"] diff --git a/target/debian-bookworm-11/boot/entrypoint b/target/debian-bookworm-11/boot/entrypoint new file mode 100755 index 00000000..2fe72577 --- /dev/null +++ b/target/debian-bookworm-11/boot/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=boot + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-11/lein/Dockerfile b/target/debian-bookworm-11/lein/Dockerfile new file mode 100644 index 00000000..f62ad5db --- /dev/null +++ b/target/debian-bookworm-11/lein/Dockerfile @@ -0,0 +1,44 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +CMD ["lein", "repl"] diff --git a/target/debian-bookworm-11/lein/entrypoint b/target/debian-bookworm-11/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-11/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-11/tools-deps/Dockerfile b/target/debian-bookworm-11/tools-deps/Dockerfile new file mode 100644 index 00000000..9be6ee14 --- /dev/null +++ b/target/debian-bookworm-11/tools-deps/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +CMD ["clj"] diff --git a/target/eclipse-temurin-17-jdk-jammy/latest/entrypoint b/target/debian-bookworm-11/tools-deps/entrypoint similarity index 100% rename from target/eclipse-temurin-17-jdk-jammy/latest/entrypoint rename to target/debian-bookworm-11/tools-deps/entrypoint diff --git a/target/eclipse-temurin-17-jdk-jammy/latest/rlwrap.retry b/target/debian-bookworm-11/tools-deps/rlwrap.retry similarity index 100% rename from target/eclipse-temurin-17-jdk-jammy/latest/rlwrap.retry rename to target/debian-bookworm-11/tools-deps/rlwrap.retry diff --git a/target/debian-bookworm-17/boot/Dockerfile b/target/debian-bookworm-17/boot/Dockerfile new file mode 100644 index 00000000..ecc9431c --- /dev/null +++ b/target/debian-bookworm-17/boot/Dockerfile @@ -0,0 +1,36 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV BOOT_VERSION=2.8.3 +ENV BOOT_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# NOTE: BOOT_VERSION tells the boot.sh script which version of boot to install +# on its first run. We always download the latest version of boot.sh because +# it is just the installer script. +RUN \ +apt-get update && \ +apt-get install -y make wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $BOOT_INSTALL && \ +wget -q https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && \ +echo "Comparing installer checksum..." && \ +sha256sum boot.sh && \ +echo "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3 *boot.sh" | sha256sum -c - && \ +mv boot.sh $BOOT_INSTALL/boot && \ +chmod 0755 $BOOT_INSTALL/boot && \ +apt-get purge -y --auto-remove wget + +ENV PATH=$PATH:$BOOT_INSTALL +ENV BOOT_AS_ROOT=yes + +RUN boot + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-17/boot/entrypoint b/target/debian-bookworm-17/boot/entrypoint new file mode 100755 index 00000000..2fe72577 --- /dev/null +++ b/target/debian-bookworm-17/boot/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=boot + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-17/lein/Dockerfile b/target/debian-bookworm-17/lein/Dockerfile new file mode 100644 index 00000000..128e1139 --- /dev/null +++ b/target/debian-bookworm-17/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-17/lein/entrypoint b/target/debian-bookworm-17/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-17/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-17/tools-deps/Dockerfile b/target/debian-bookworm-17/tools-deps/Dockerfile new file mode 100644 index 00000000..007ec1e4 --- /dev/null +++ b/target/debian-bookworm-17/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bookworm-17/tools-deps/entrypoint b/target/debian-bookworm-17/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-17/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-17/tools-deps/rlwrap.retry b/target/debian-bookworm-17/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-17/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-20/lein/Dockerfile b/target/debian-bookworm-20/lein/Dockerfile new file mode 100644 index 00000000..ba39052c --- /dev/null +++ b/target/debian-bookworm-20/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:20 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-20/lein/entrypoint b/target/debian-bookworm-20/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-20/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-20/tools-deps/Dockerfile b/target/debian-bookworm-20/tools-deps/Dockerfile new file mode 100644 index 00000000..faf76d5e --- /dev/null +++ b/target/debian-bookworm-20/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:20 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bookworm-20/tools-deps/entrypoint b/target/debian-bookworm-20/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-20/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-20/tools-deps/rlwrap.retry b/target/debian-bookworm-20/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-20/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/eclipse-temurin-17-jdk-jammy/latest/Dockerfile b/target/debian-bookworm-21/latest/Dockerfile similarity index 91% rename from target/eclipse-temurin-17-jdk-jammy/latest/Dockerfile rename to target/debian-bookworm-21/latest/Dockerfile index e1ddd5ff..3a84ca08 100644 --- a/target/eclipse-temurin-17-jdk-jammy/latest/Dockerfile +++ b/target/debian-bookworm-21/latest/Dockerfile @@ -1,4 +1,8 @@ -FROM eclipse-temurin:17-jdk-jammy +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" ### INSTALL LEIN ### @@ -46,7 +50,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y make git rlwrap wget && \ +apt-get install -y curl make git rlwrap wget && \ rm -rf /var/lib/apt/lists/* && \ wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -55,7 +59,7 @@ chmod +x linux-install-$CLOJURE_VERSION.sh && \ ./linux-install-$CLOJURE_VERSION.sh && \ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ -apt-get purge -y --auto-remove wget +apt-get purge -y --auto-remove curl wget # Docker bug makes rlwrap crash w/o short sleep first # Bug: https://github.com/moby/moby/issues/28009 diff --git a/target/debian-bookworm-21/latest/entrypoint b/target/debian-bookworm-21/latest/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-21/latest/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-21/latest/rlwrap.retry b/target/debian-bookworm-21/latest/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-21/latest/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-21/lein/Dockerfile b/target/debian-bookworm-21/lein/Dockerfile new file mode 100644 index 00000000..7d308beb --- /dev/null +++ b/target/debian-bookworm-21/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-21/lein/entrypoint b/target/debian-bookworm-21/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-21/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-21/tools-deps/Dockerfile b/target/debian-bookworm-21/tools-deps/Dockerfile new file mode 100644 index 00000000..8c369fc0 --- /dev/null +++ b/target/debian-bookworm-21/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bookworm-21/tools-deps/entrypoint b/target/debian-bookworm-21/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-21/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-21/tools-deps/rlwrap.retry b/target/debian-bookworm-21/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-21/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-8/boot/Dockerfile b/target/debian-bookworm-8/boot/Dockerfile new file mode 100644 index 00000000..dcc547ec --- /dev/null +++ b/target/debian-bookworm-8/boot/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:8 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV BOOT_VERSION=2.8.3 +ENV BOOT_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# NOTE: BOOT_VERSION tells the boot.sh script which version of boot to install +# on its first run. We always download the latest version of boot.sh because +# it is just the installer script. +RUN \ +apt-get update && \ +apt-get install -y make wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $BOOT_INSTALL && \ +wget -q https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && \ +echo "Comparing installer checksum..." && \ +sha256sum boot.sh && \ +echo "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3 *boot.sh" | sha256sum -c - && \ +mv boot.sh $BOOT_INSTALL/boot && \ +chmod 0755 $BOOT_INSTALL/boot && \ +apt-get purge -y --auto-remove wget + +ENV PATH=$PATH:$BOOT_INSTALL +ENV BOOT_AS_ROOT=yes + +RUN boot + +CMD ["boot", "repl"] diff --git a/target/debian-bookworm-8/boot/entrypoint b/target/debian-bookworm-8/boot/entrypoint new file mode 100755 index 00000000..2fe72577 --- /dev/null +++ b/target/debian-bookworm-8/boot/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=boot + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-8/lein/Dockerfile b/target/debian-bookworm-8/lein/Dockerfile new file mode 100644 index 00000000..1e123aad --- /dev/null +++ b/target/debian-bookworm-8/lein/Dockerfile @@ -0,0 +1,44 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:8 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +CMD ["lein", "repl"] diff --git a/target/debian-bookworm-8/lein/entrypoint b/target/debian-bookworm-8/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-8/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-8/tools-deps/Dockerfile b/target/debian-bookworm-8/tools-deps/Dockerfile new file mode 100644 index 00000000..13b0d63a --- /dev/null +++ b/target/debian-bookworm-8/tools-deps/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:bookworm + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:8 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +CMD ["clj"] diff --git a/target/debian-bookworm-8/tools-deps/entrypoint b/target/debian-bookworm-8/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-8/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-8/tools-deps/rlwrap.retry b/target/debian-bookworm-8/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-8/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-slim-11/boot/Dockerfile b/target/debian-bookworm-slim-11/boot/Dockerfile new file mode 100644 index 00000000..b0151364 --- /dev/null +++ b/target/debian-bookworm-slim-11/boot/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV BOOT_VERSION=2.8.3 +ENV BOOT_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# NOTE: BOOT_VERSION tells the boot.sh script which version of boot to install +# on its first run. We always download the latest version of boot.sh because +# it is just the installer script. +RUN \ +apt-get update && \ +apt-get install -y wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $BOOT_INSTALL && \ +wget -q https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && \ +echo "Comparing installer checksum..." && \ +sha256sum boot.sh && \ +echo "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3 *boot.sh" | sha256sum -c - && \ +mv boot.sh $BOOT_INSTALL/boot && \ +chmod 0755 $BOOT_INSTALL/boot && \ +apt-get purge -y --auto-remove wget + +ENV PATH=$PATH:$BOOT_INSTALL +ENV BOOT_AS_ROOT=yes + +RUN boot + +CMD ["boot", "repl"] diff --git a/target/debian-bookworm-slim-11/boot/entrypoint b/target/debian-bookworm-slim-11/boot/entrypoint new file mode 100755 index 00000000..2fe72577 --- /dev/null +++ b/target/debian-bookworm-slim-11/boot/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=boot + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-11/lein/Dockerfile b/target/debian-bookworm-slim-11/lein/Dockerfile new file mode 100644 index 00000000..26f56d6a --- /dev/null +++ b/target/debian-bookworm-slim-11/lein/Dockerfile @@ -0,0 +1,44 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +CMD ["lein", "repl"] diff --git a/target/debian-bookworm-slim-11/lein/entrypoint b/target/debian-bookworm-slim-11/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-slim-11/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-11/tools-deps/Dockerfile b/target/debian-bookworm-slim-11/tools-deps/Dockerfile new file mode 100644 index 00000000..0b231803 --- /dev/null +++ b/target/debian-bookworm-slim-11/tools-deps/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +CMD ["clj"] diff --git a/target/debian-bookworm-slim-11/tools-deps/entrypoint b/target/debian-bookworm-slim-11/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-slim-11/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-11/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-11/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-slim-11/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-slim-17/boot/Dockerfile b/target/debian-bookworm-slim-17/boot/Dockerfile new file mode 100644 index 00000000..b8445247 --- /dev/null +++ b/target/debian-bookworm-slim-17/boot/Dockerfile @@ -0,0 +1,36 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV BOOT_VERSION=2.8.3 +ENV BOOT_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# NOTE: BOOT_VERSION tells the boot.sh script which version of boot to install +# on its first run. We always download the latest version of boot.sh because +# it is just the installer script. +RUN \ +apt-get update && \ +apt-get install -y wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $BOOT_INSTALL && \ +wget -q https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && \ +echo "Comparing installer checksum..." && \ +sha256sum boot.sh && \ +echo "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3 *boot.sh" | sha256sum -c - && \ +mv boot.sh $BOOT_INSTALL/boot && \ +chmod 0755 $BOOT_INSTALL/boot && \ +apt-get purge -y --auto-remove wget + +ENV PATH=$PATH:$BOOT_INSTALL +ENV BOOT_AS_ROOT=yes + +RUN boot + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-slim-17/boot/entrypoint b/target/debian-bookworm-slim-17/boot/entrypoint new file mode 100755 index 00000000..2fe72577 --- /dev/null +++ b/target/debian-bookworm-slim-17/boot/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=boot + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-17/lein/Dockerfile b/target/debian-bookworm-slim-17/lein/Dockerfile new file mode 100644 index 00000000..f3d2f693 --- /dev/null +++ b/target/debian-bookworm-slim-17/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-slim-17/lein/entrypoint b/target/debian-bookworm-slim-17/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-slim-17/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-17/tools-deps/Dockerfile b/target/debian-bookworm-slim-17/tools-deps/Dockerfile new file mode 100644 index 00000000..a12a79fe --- /dev/null +++ b/target/debian-bookworm-slim-17/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bookworm-slim-17/tools-deps/entrypoint b/target/debian-bookworm-slim-17/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-slim-17/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-17/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-17/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-slim-17/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-slim-20/lein/Dockerfile b/target/debian-bookworm-slim-20/lein/Dockerfile new file mode 100644 index 00000000..d6a5893c --- /dev/null +++ b/target/debian-bookworm-slim-20/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:20 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-slim-20/lein/entrypoint b/target/debian-bookworm-slim-20/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-slim-20/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-20/tools-deps/Dockerfile b/target/debian-bookworm-slim-20/tools-deps/Dockerfile new file mode 100644 index 00000000..16edf74d --- /dev/null +++ b/target/debian-bookworm-slim-20/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:20 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bookworm-slim-20/tools-deps/entrypoint b/target/debian-bookworm-slim-20/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-slim-20/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-20/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-20/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-slim-20/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-slim-21/lein/Dockerfile b/target/debian-bookworm-slim-21/lein/Dockerfile new file mode 100644 index 00000000..8819aff4 --- /dev/null +++ b/target/debian-bookworm-slim-21/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bookworm-slim-21/lein/entrypoint b/target/debian-bookworm-slim-21/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-slim-21/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-21/tools-deps/Dockerfile b/target/debian-bookworm-slim-21/tools-deps/Dockerfile new file mode 100644 index 00000000..168ba9e5 --- /dev/null +++ b/target/debian-bookworm-slim-21/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bookworm-slim-21/tools-deps/entrypoint b/target/debian-bookworm-slim-21/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-slim-21/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-21/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-21/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-slim-21/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bookworm-slim-8/boot/Dockerfile b/target/debian-bookworm-slim-8/boot/Dockerfile new file mode 100644 index 00000000..a2429ba9 --- /dev/null +++ b/target/debian-bookworm-slim-8/boot/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:8 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV BOOT_VERSION=2.8.3 +ENV BOOT_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# NOTE: BOOT_VERSION tells the boot.sh script which version of boot to install +# on its first run. We always download the latest version of boot.sh because +# it is just the installer script. +RUN \ +apt-get update && \ +apt-get install -y wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $BOOT_INSTALL && \ +wget -q https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && \ +echo "Comparing installer checksum..." && \ +sha256sum boot.sh && \ +echo "0ccd697f2027e7e1cd3be3d62721057cbc841585740d0aaa9fbb485d7b1f17c3 *boot.sh" | sha256sum -c - && \ +mv boot.sh $BOOT_INSTALL/boot && \ +chmod 0755 $BOOT_INSTALL/boot && \ +apt-get purge -y --auto-remove wget + +ENV PATH=$PATH:$BOOT_INSTALL +ENV BOOT_AS_ROOT=yes + +RUN boot + +CMD ["boot", "repl"] diff --git a/target/debian-bookworm-slim-8/boot/entrypoint b/target/debian-bookworm-slim-8/boot/entrypoint new file mode 100755 index 00000000..2fe72577 --- /dev/null +++ b/target/debian-bookworm-slim-8/boot/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=boot + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-8/lein/Dockerfile b/target/debian-bookworm-slim-8/lein/Dockerfile new file mode 100644 index 00000000..9af0e13d --- /dev/null +++ b/target/debian-bookworm-slim-8/lein/Dockerfile @@ -0,0 +1,44 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:8 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +CMD ["lein", "repl"] diff --git a/target/debian-bookworm-slim-8/lein/entrypoint b/target/debian-bookworm-slim-8/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bookworm-slim-8/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-8/tools-deps/Dockerfile b/target/debian-bookworm-slim-8/tools-deps/Dockerfile new file mode 100644 index 00000000..b09de7c7 --- /dev/null +++ b/target/debian-bookworm-slim-8/tools-deps/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:bookworm-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:8 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +CMD ["clj"] diff --git a/target/debian-bookworm-slim-8/tools-deps/entrypoint b/target/debian-bookworm-slim-8/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bookworm-slim-8/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bookworm-slim-8/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-8/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bookworm-slim-8/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bullseye-21/lein/Dockerfile b/target/debian-bullseye-21/lein/Dockerfile new file mode 100644 index 00000000..42e0a95e --- /dev/null +++ b/target/debian-bullseye-21/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bullseye + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bullseye-21/lein/entrypoint b/target/debian-bullseye-21/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bullseye-21/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bullseye-21/tools-deps/Dockerfile b/target/debian-bullseye-21/tools-deps/Dockerfile new file mode 100644 index 00000000..c39d8ac1 --- /dev/null +++ b/target/debian-bullseye-21/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bullseye + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bullseye-21/tools-deps/entrypoint b/target/debian-bullseye-21/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bullseye-21/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bullseye-21/tools-deps/rlwrap.retry b/target/debian-bullseye-21/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bullseye-21/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/debian-bullseye-slim-21/lein/Dockerfile b/target/debian-bullseye-slim-21/lein/Dockerfile new file mode 100644 index 00000000..e597cc6f --- /dev/null +++ b/target/debian-bullseye-slim-21/lein/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bullseye-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/debian-bullseye-slim-21/lein/entrypoint b/target/debian-bullseye-slim-21/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/debian-bullseye-slim-21/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bullseye-slim-21/tools-deps/Dockerfile b/target/debian-bullseye-slim-21/tools-deps/Dockerfile new file mode 100644 index 00000000..c360405d --- /dev/null +++ b/target/debian-bullseye-slim-21/tools-deps/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bullseye-slim + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove curl wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/debian-bullseye-slim-21/tools-deps/entrypoint b/target/debian-bullseye-slim-21/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/debian-bullseye-slim-21/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/debian-bullseye-slim-21/tools-deps/rlwrap.retry b/target/debian-bullseye-slim-21/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/debian-bullseye-slim-21/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/eclipse-temurin-21-jdk-alpine/lein/Dockerfile b/target/eclipse-temurin-21-jdk-alpine/lein/Dockerfile new file mode 100644 index 00000000..4dd8e5ec --- /dev/null +++ b/target/eclipse-temurin-21-jdk-alpine/lein/Dockerfile @@ -0,0 +1,41 @@ +FROM eclipse-temurin:21-jdk-alpine + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apk add --no-cache ca-certificates bash tar openssl gnupg && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apk del ca-certificates tar openssl gnupg + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/eclipse-temurin-21-jdk-alpine/lein/entrypoint b/target/eclipse-temurin-21-jdk-alpine/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/eclipse-temurin-21-jdk-alpine/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile b/target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile new file mode 100644 index 00000000..bc192515 --- /dev/null +++ b/target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile @@ -0,0 +1,26 @@ +FROM eclipse-temurin:21-jdk-alpine + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apk add --no-cache curl bash make git && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apk del curl + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/eclipse-temurin-21-jdk-alpine/tools-deps/entrypoint b/target/eclipse-temurin-21-jdk-alpine/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/eclipse-temurin-21-jdk-alpine/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry b/target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done diff --git a/target/eclipse-temurin-21-jdk-jammy/lein/Dockerfile b/target/eclipse-temurin-21-jdk-jammy/lein/Dockerfile new file mode 100644 index 00000000..6ea1948b --- /dev/null +++ b/target/eclipse-temurin-21-jdk-jammy/lein/Dockerfile @@ -0,0 +1,43 @@ +FROM eclipse-temurin:21-jdk-jammy + +ENV LEIN_VERSION=2.10.0 +ENV LEIN_INSTALL=/usr/local/bin/ + +WORKDIR /tmp + +# Download the whole repo as an archive +RUN set -eux; \ +apt-get update && \ +apt-get install -y make gnupg wget && \ +rm -rf /var/lib/apt/lists/* && \ +mkdir -p $LEIN_INSTALL && \ +wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \ +echo "Comparing lein-pkg checksum ..." && \ +sha256sum lein-pkg && \ +echo "b1757ce941e4cbf15cbf649b7b4f413365e612da892d22841ec1728391bb66af *lein-pkg" | sha256sum -c - && \ +mv lein-pkg $LEIN_INSTALL/lein && \ +chmod 0755 $LEIN_INSTALL/lein && \ +export GNUPGHOME="$(mktemp -d)" && \ +export FILENAME_EXT=jar && \ +gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 6A2D483DB59437EBB97D09B1040193357D0606ED && \ +wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \ +wget -q https://codeberg.org/leiningen/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 -rf "$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 && \ +apt-get purge -y --auto-remove gnupg wget + +ENV PATH=$PATH:$LEIN_INSTALL +ENV LEIN_ROOT 1 + +# Install clojure 1.11.1 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/eclipse-temurin-21-jdk-jammy/lein/entrypoint b/target/eclipse-temurin-21-jdk-jammy/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/eclipse-temurin-21-jdk-jammy/lein/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=lein + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile b/target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile new file mode 100644 index 00000000..6a72b15a --- /dev/null +++ b/target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile @@ -0,0 +1,28 @@ +FROM eclipse-temurin:21-jdk-jammy + +ENV CLOJURE_VERSION=1.11.1.1413 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y make git rlwrap wget && \ +rm -rf /var/lib/apt/lists/* && \ +wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "ad9aa1e99c59a4f7eb66450914fbec543337d9fada60dd9d34eec7fe18ae4965 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \ +chmod +x linux-install-$CLOJURE_VERSION.sh && \ +./linux-install-$CLOJURE_VERSION.sh && \ +rm linux-install-$CLOJURE_VERSION.sh && \ +clojure -e "(clojure-version)" && \ +apt-get purge -y --auto-remove wget + +# Docker bug makes rlwrap crash w/o short sleep first +# Bug: https://github.com/moby/moby/issues/28009 +# As of 2021-09-10 this bug still exists, despite that issue being closed +COPY rlwrap.retry /usr/local/bin/rlwrap + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["-M", "--repl"] diff --git a/target/eclipse-temurin-21-jdk-jammy/tools-deps/entrypoint b/target/eclipse-temurin-21-jdk-jammy/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/eclipse-temurin-21-jdk-jammy/tools-deps/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +entrypoint=clj + +cmd=${1:-} + +# check if the first arg starts with a hyphen +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then + exec "${entrypoint}" "$@" +fi + +if [[ -n "${cmd}" ]]; then + # see if help for the subcommand is successful + if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then + exec "${entrypoint}" "$@" + fi +fi + +exec "$@" diff --git a/target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry b/target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry @@ -0,0 +1,30 @@ +#!/bin/sh + +# This script works around a Docker bug that prevents rlwrap from starting +# right when a container is first started. It is intended to replace +# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH +# (e.g. /usr/local/bin). + +max_tries=100 # 100 tries is ~1 second +try=0 + +while true; do + # see if rlwrap can start at all + output=$(/usr/bin/rlwrap true 2>&1 >/dev/null) + exit_code=$? + if [ $exit_code -gt 0 ]; then + # it didn't start + try=$((try+1)) + if [ $try -gt $max_tries ]; then + # we're at max attempts so output the error and exit w/ the same code + echo "$output" >&2 + exit $exit_code + else + # wait a bit and try again + sleep 0.01 + fi + else + # rlwrap can start so let's run it for real + exec /usr/bin/rlwrap "$@" + fi +done