From 92e40d767592ea6e823dfa1ee7edc4cbd622bdb6 Mon Sep 17 00:00:00 2001 From: Oleksandr Yakushev Date: Tue, 23 Jul 2024 09:36:53 +0300 Subject: [PATCH] Update Dockerfiles to use Ubuntu Noble images --- .../lein/Dockerfile | 2 +- .../lein/entrypoint | 0 .../tools-deps/Dockerfile | 2 +- .../tools-deps/entrypoint | 0 .../tools-deps/rlwrap.retry | 0 .../lein/Dockerfile | 2 +- .../lein/entrypoint | 0 .../tools-deps/Dockerfile | 2 +- .../tools-deps/entrypoint | 0 .../tools-deps/rlwrap.retry | 0 .../lein/Dockerfile | 44 +++++++++++++++++++ .../lein/entrypoint | 0 .../tools-deps/Dockerfile | 27 ++++++++++++ .../tools-deps/entrypoint | 0 .../tools-deps/rlwrap.retry | 0 .../lein/Dockerfile | 44 +++++++++++++++++++ .../lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 27 ++++++++++++ .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 +++++++++++++ .../lein/Dockerfile | 2 +- .../lein/entrypoint | 21 +++++++++ .../tools-deps/Dockerfile | 2 +- .../tools-deps/entrypoint | 21 +++++++++ .../tools-deps/rlwrap.retry | 30 +++++++++++++ 25 files changed, 292 insertions(+), 6 deletions(-) rename target/{eclipse-temurin-11-jdk-focal => eclipse-temurin-11-jdk-noble}/lein/Dockerfile (98%) rename target/{eclipse-temurin-11-jdk-focal => eclipse-temurin-11-jdk-noble}/lein/entrypoint (100%) rename target/{eclipse-temurin-11-jdk-focal => eclipse-temurin-11-jdk-noble}/tools-deps/Dockerfile (95%) rename target/{eclipse-temurin-11-jdk-focal => eclipse-temurin-11-jdk-noble}/tools-deps/entrypoint (100%) rename target/{eclipse-temurin-11-jdk-focal => eclipse-temurin-11-jdk-noble}/tools-deps/rlwrap.retry (100%) rename target/{eclipse-temurin-17-jdk-focal => eclipse-temurin-17-jdk-noble}/lein/Dockerfile (98%) rename target/{eclipse-temurin-17-jdk-focal => eclipse-temurin-17-jdk-noble}/lein/entrypoint (100%) rename target/{eclipse-temurin-17-jdk-focal => eclipse-temurin-17-jdk-noble}/tools-deps/Dockerfile (96%) rename target/{eclipse-temurin-17-jdk-focal => eclipse-temurin-17-jdk-noble}/tools-deps/entrypoint (100%) rename target/{eclipse-temurin-17-jdk-focal => eclipse-temurin-17-jdk-noble}/tools-deps/rlwrap.retry (100%) create mode 100644 target/eclipse-temurin-21-jdk-noble/lein/Dockerfile rename target/{eclipse-temurin-8-jdk-focal => eclipse-temurin-21-jdk-noble}/lein/entrypoint (100%) create mode 100644 target/eclipse-temurin-21-jdk-noble/tools-deps/Dockerfile rename target/{eclipse-temurin-8-jdk-focal => eclipse-temurin-21-jdk-noble}/tools-deps/entrypoint (100%) rename target/{eclipse-temurin-8-jdk-focal => eclipse-temurin-21-jdk-noble}/tools-deps/rlwrap.retry (100%) create mode 100644 target/eclipse-temurin-22-jdk-noble/lein/Dockerfile create mode 100755 target/eclipse-temurin-22-jdk-noble/lein/entrypoint create mode 100644 target/eclipse-temurin-22-jdk-noble/tools-deps/Dockerfile create mode 100755 target/eclipse-temurin-22-jdk-noble/tools-deps/entrypoint create mode 100755 target/eclipse-temurin-22-jdk-noble/tools-deps/rlwrap.retry rename target/{eclipse-temurin-8-jdk-focal => eclipse-temurin-8-jdk-noble}/lein/Dockerfile (98%) create mode 100755 target/eclipse-temurin-8-jdk-noble/lein/entrypoint rename target/{eclipse-temurin-8-jdk-focal => eclipse-temurin-8-jdk-noble}/tools-deps/Dockerfile (96%) create mode 100755 target/eclipse-temurin-8-jdk-noble/tools-deps/entrypoint create mode 100755 target/eclipse-temurin-8-jdk-noble/tools-deps/rlwrap.retry diff --git a/target/eclipse-temurin-11-jdk-focal/lein/Dockerfile b/target/eclipse-temurin-11-jdk-noble/lein/Dockerfile similarity index 98% rename from target/eclipse-temurin-11-jdk-focal/lein/Dockerfile rename to target/eclipse-temurin-11-jdk-noble/lein/Dockerfile index 3c72c7de..b08a43d1 100644 --- a/target/eclipse-temurin-11-jdk-focal/lein/Dockerfile +++ b/target/eclipse-temurin-11-jdk-noble/lein/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:11-jdk-focal +FROM eclipse-temurin:11-jdk-noble ENV LEIN_VERSION=2.11.2 ENV LEIN_INSTALL=/usr/local/bin/ diff --git a/target/eclipse-temurin-11-jdk-focal/lein/entrypoint b/target/eclipse-temurin-11-jdk-noble/lein/entrypoint similarity index 100% rename from target/eclipse-temurin-11-jdk-focal/lein/entrypoint rename to target/eclipse-temurin-11-jdk-noble/lein/entrypoint diff --git a/target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile b/target/eclipse-temurin-11-jdk-noble/tools-deps/Dockerfile similarity index 95% rename from target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile rename to target/eclipse-temurin-11-jdk-noble/tools-deps/Dockerfile index 2e934a33..93dc3bf5 100644 --- a/target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile +++ b/target/eclipse-temurin-11-jdk-noble/tools-deps/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:11-jdk-focal +FROM eclipse-temurin:11-jdk-noble ENV CLOJURE_VERSION=1.11.3.1456 diff --git a/target/eclipse-temurin-11-jdk-focal/tools-deps/entrypoint b/target/eclipse-temurin-11-jdk-noble/tools-deps/entrypoint similarity index 100% rename from target/eclipse-temurin-11-jdk-focal/tools-deps/entrypoint rename to target/eclipse-temurin-11-jdk-noble/tools-deps/entrypoint diff --git a/target/eclipse-temurin-11-jdk-focal/tools-deps/rlwrap.retry b/target/eclipse-temurin-11-jdk-noble/tools-deps/rlwrap.retry similarity index 100% rename from target/eclipse-temurin-11-jdk-focal/tools-deps/rlwrap.retry rename to target/eclipse-temurin-11-jdk-noble/tools-deps/rlwrap.retry diff --git a/target/eclipse-temurin-17-jdk-focal/lein/Dockerfile b/target/eclipse-temurin-17-jdk-noble/lein/Dockerfile similarity index 98% rename from target/eclipse-temurin-17-jdk-focal/lein/Dockerfile rename to target/eclipse-temurin-17-jdk-noble/lein/Dockerfile index c509da7c..6fb628f8 100644 --- a/target/eclipse-temurin-17-jdk-focal/lein/Dockerfile +++ b/target/eclipse-temurin-17-jdk-noble/lein/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17-jdk-focal +FROM eclipse-temurin:17-jdk-noble ENV LEIN_VERSION=2.11.2 ENV LEIN_INSTALL=/usr/local/bin/ diff --git a/target/eclipse-temurin-17-jdk-focal/lein/entrypoint b/target/eclipse-temurin-17-jdk-noble/lein/entrypoint similarity index 100% rename from target/eclipse-temurin-17-jdk-focal/lein/entrypoint rename to target/eclipse-temurin-17-jdk-noble/lein/entrypoint diff --git a/target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile b/target/eclipse-temurin-17-jdk-noble/tools-deps/Dockerfile similarity index 96% rename from target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile rename to target/eclipse-temurin-17-jdk-noble/tools-deps/Dockerfile index c12384a9..4af04124 100644 --- a/target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile +++ b/target/eclipse-temurin-17-jdk-noble/tools-deps/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17-jdk-focal +FROM eclipse-temurin:17-jdk-noble ENV CLOJURE_VERSION=1.11.3.1456 diff --git a/target/eclipse-temurin-17-jdk-focal/tools-deps/entrypoint b/target/eclipse-temurin-17-jdk-noble/tools-deps/entrypoint similarity index 100% rename from target/eclipse-temurin-17-jdk-focal/tools-deps/entrypoint rename to target/eclipse-temurin-17-jdk-noble/tools-deps/entrypoint diff --git a/target/eclipse-temurin-17-jdk-focal/tools-deps/rlwrap.retry b/target/eclipse-temurin-17-jdk-noble/tools-deps/rlwrap.retry similarity index 100% rename from target/eclipse-temurin-17-jdk-focal/tools-deps/rlwrap.retry rename to target/eclipse-temurin-17-jdk-noble/tools-deps/rlwrap.retry diff --git a/target/eclipse-temurin-21-jdk-noble/lein/Dockerfile b/target/eclipse-temurin-21-jdk-noble/lein/Dockerfile new file mode 100644 index 00000000..d5cd65ee --- /dev/null +++ b/target/eclipse-temurin-21-jdk-noble/lein/Dockerfile @@ -0,0 +1,44 @@ +FROM eclipse-temurin:21-jdk-noble + +ENV LEIN_VERSION=2.11.2 +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 git 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 "28a1a62668c5f427b413a8677e376affaa995f023b1fcd06e2d4c98ac1df5f3e *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 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \ +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 && \ +mkdir -p /root/.lein && \ +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.3 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.3"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/eclipse-temurin-8-jdk-focal/lein/entrypoint b/target/eclipse-temurin-21-jdk-noble/lein/entrypoint similarity index 100% rename from target/eclipse-temurin-8-jdk-focal/lein/entrypoint rename to target/eclipse-temurin-21-jdk-noble/lein/entrypoint diff --git a/target/eclipse-temurin-21-jdk-noble/tools-deps/Dockerfile b/target/eclipse-temurin-21-jdk-noble/tools-deps/Dockerfile new file mode 100644 index 00000000..0cd6fd67 --- /dev/null +++ b/target/eclipse-temurin-21-jdk-noble/tools-deps/Dockerfile @@ -0,0 +1,27 @@ +FROM eclipse-temurin:21-jdk-noble + +ENV CLOJURE_VERSION=1.11.3.1456 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap && \ +rm -rf /var/lib/apt/lists/* && \ +curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "2f5edc801133c72a49e990816b0e245beb8b4e35a85524b4dd0b3fa03a4a5365 *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)" + +# 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-8-jdk-focal/tools-deps/entrypoint b/target/eclipse-temurin-21-jdk-noble/tools-deps/entrypoint similarity index 100% rename from target/eclipse-temurin-8-jdk-focal/tools-deps/entrypoint rename to target/eclipse-temurin-21-jdk-noble/tools-deps/entrypoint diff --git a/target/eclipse-temurin-8-jdk-focal/tools-deps/rlwrap.retry b/target/eclipse-temurin-21-jdk-noble/tools-deps/rlwrap.retry similarity index 100% rename from target/eclipse-temurin-8-jdk-focal/tools-deps/rlwrap.retry rename to target/eclipse-temurin-21-jdk-noble/tools-deps/rlwrap.retry diff --git a/target/eclipse-temurin-22-jdk-noble/lein/Dockerfile b/target/eclipse-temurin-22-jdk-noble/lein/Dockerfile new file mode 100644 index 00000000..f5369166 --- /dev/null +++ b/target/eclipse-temurin-22-jdk-noble/lein/Dockerfile @@ -0,0 +1,44 @@ +FROM eclipse-temurin:22-jdk-noble + +ENV LEIN_VERSION=2.11.2 +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 git 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 "28a1a62668c5f427b413a8677e376affaa995f023b1fcd06e2d4c98ac1df5f3e *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 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \ +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 && \ +mkdir -p /root/.lein && \ +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.3 so users don't have to download it every time +RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.3"]])' > project.clj \ + && lein deps && rm project.clj + +COPY entrypoint /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] +CMD ["repl"] diff --git a/target/eclipse-temurin-22-jdk-noble/lein/entrypoint b/target/eclipse-temurin-22-jdk-noble/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/eclipse-temurin-22-jdk-noble/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-22-jdk-noble/tools-deps/Dockerfile b/target/eclipse-temurin-22-jdk-noble/tools-deps/Dockerfile new file mode 100644 index 00000000..c31e13ab --- /dev/null +++ b/target/eclipse-temurin-22-jdk-noble/tools-deps/Dockerfile @@ -0,0 +1,27 @@ +FROM eclipse-temurin:22-jdk-noble + +ENV CLOJURE_VERSION=1.11.3.1456 + +WORKDIR /tmp + +RUN \ +apt-get update && \ +apt-get install -y curl make git rlwrap && \ +rm -rf /var/lib/apt/lists/* && \ +curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ +sha256sum linux-install-$CLOJURE_VERSION.sh && \ +echo "2f5edc801133c72a49e990816b0e245beb8b4e35a85524b4dd0b3fa03a4a5365 *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)" + +# 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-22-jdk-noble/tools-deps/entrypoint b/target/eclipse-temurin-22-jdk-noble/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/eclipse-temurin-22-jdk-noble/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-22-jdk-noble/tools-deps/rlwrap.retry b/target/eclipse-temurin-22-jdk-noble/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/eclipse-temurin-22-jdk-noble/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-8-jdk-focal/lein/Dockerfile b/target/eclipse-temurin-8-jdk-noble/lein/Dockerfile similarity index 98% rename from target/eclipse-temurin-8-jdk-focal/lein/Dockerfile rename to target/eclipse-temurin-8-jdk-noble/lein/Dockerfile index 1c7c30f3..e9fc49d5 100644 --- a/target/eclipse-temurin-8-jdk-focal/lein/Dockerfile +++ b/target/eclipse-temurin-8-jdk-noble/lein/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:8-jdk-focal +FROM eclipse-temurin:8-jdk-noble ENV LEIN_VERSION=2.11.2 ENV LEIN_INSTALL=/usr/local/bin/ diff --git a/target/eclipse-temurin-8-jdk-noble/lein/entrypoint b/target/eclipse-temurin-8-jdk-noble/lein/entrypoint new file mode 100755 index 00000000..ccf8cce5 --- /dev/null +++ b/target/eclipse-temurin-8-jdk-noble/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-8-jdk-focal/tools-deps/Dockerfile b/target/eclipse-temurin-8-jdk-noble/tools-deps/Dockerfile similarity index 96% rename from target/eclipse-temurin-8-jdk-focal/tools-deps/Dockerfile rename to target/eclipse-temurin-8-jdk-noble/tools-deps/Dockerfile index be1dad1a..8de31f14 100644 --- a/target/eclipse-temurin-8-jdk-focal/tools-deps/Dockerfile +++ b/target/eclipse-temurin-8-jdk-noble/tools-deps/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:8-jdk-focal +FROM eclipse-temurin:8-jdk-noble ENV CLOJURE_VERSION=1.11.3.1456 diff --git a/target/eclipse-temurin-8-jdk-noble/tools-deps/entrypoint b/target/eclipse-temurin-8-jdk-noble/tools-deps/entrypoint new file mode 100755 index 00000000..51561d1d --- /dev/null +++ b/target/eclipse-temurin-8-jdk-noble/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-8-jdk-noble/tools-deps/rlwrap.retry b/target/eclipse-temurin-8-jdk-noble/tools-deps/rlwrap.retry new file mode 100755 index 00000000..83cefbfb --- /dev/null +++ b/target/eclipse-temurin-8-jdk-noble/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