diff --git a/resources/clj.sh b/resources/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/resources/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/resources/rlwrap.retry b/resources/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/resources/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/src/docker_clojure/dockerfile/tools_deps.clj b/src/docker_clojure/dockerfile/tools_deps.clj index f5105cec..d8d4e272 100644 --- a/src/docker_clojure/dockerfile/tools_deps.clj +++ b/src/docker_clojure/dockerfile/tools_deps.clj @@ -4,18 +4,18 @@ install-distro-deps uninstall-distro-build-deps]])) (defn prereqs [dir _variant] - (copy-resource-file! dir "rlwrap.retry" identity + (copy-resource-file! dir "clj.sh" identity #(.setExecutable % true false))) (def distro-deps {:debian-slim {:build #{"curl"} - :runtime #{"rlwrap" "make" "git"}} + :runtime #{"rlfe" "make" "git"}} :debian {:build #{"curl"} - :runtime #{"rlwrap" "make" "git"}} + :runtime #{"rlfe" "make" "git"}} :ubuntu {:build #{} ;; install curl as a runtime dep b/c we need it at build time ;; but upstream includes it so we don't want to uninstall it - :runtime #{"rlwrap" "make" "git" "curl"}} + :runtime #{"rlfe" "make" "git" "curl"}} :alpine {:build #{"curl"} :runtime #{"bash" "make" "git"}}}) @@ -24,9 +24,7 @@ (def uninstall-build-deps (partial uninstall-distro-build-deps distro-deps)) (def docker-bug-notice - ["# 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"]) + ["# Custom \"clj\" script that uses rlfe instead of rlwrap"]) (defn install [installer-hashes {:keys [build-tool-version] :as variant}] (let [install-dep-cmds (install-deps variant) @@ -47,7 +45,7 @@ "clojure -e \"(clojure-version)\""] (empty? uninstall-dep-cmds)) (concat-commands uninstall-dep-cmds :end) (concat [""] docker-bug-notice - ["COPY rlwrap.retry /usr/local/bin/rlwrap"]) + ["COPY clj.sh /usr/local/bin/clj"]) (->> (remove nil?))))) (defn command [{:keys [jdk-version]}] diff --git a/target/debian-bookworm-11/tools-deps/Dockerfile b/target/debian-bookworm-11/tools-deps/Dockerfile index e71c4344..82b1a1a0 100644 --- a/target/debian-bookworm-11/tools-deps/Dockerfile +++ b/target/debian-bookworm-11/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bookworm-11/tools-deps/clj.sh b/target/debian-bookworm-11/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-11/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-11/tools-deps/rlwrap.retry b/target/debian-bookworm-11/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-11/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-17/tools-deps/Dockerfile b/target/debian-bookworm-17/tools-deps/Dockerfile index 9d44578d..121f092d 100644 --- a/target/debian-bookworm-17/tools-deps/Dockerfile +++ b/target/debian-bookworm-17/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-17/tools-deps/clj.sh b/target/debian-bookworm-17/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-17/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-17/tools-deps/rlwrap.retry b/target/debian-bookworm-17/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-17/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/latest/Dockerfile b/target/debian-bookworm-21/latest/Dockerfile index d064f973..7fee2235 100644 --- a/target/debian-bookworm-21/latest/Dockerfile +++ b/target/debian-bookworm-21/latest/Dockerfile @@ -50,7 +50,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -61,10 +61,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-21/latest/clj.sh b/target/debian-bookworm-21/latest/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-21/latest/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-21/latest/rlwrap.retry b/target/debian-bookworm-21/latest/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-21/latest/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bookworm-21/tools-deps/Dockerfile index 90220295..f71f65bb 100644 --- a/target/debian-bookworm-21/tools-deps/Dockerfile +++ b/target/debian-bookworm-21/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-21/tools-deps/clj.sh b/target/debian-bookworm-21/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-21/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-21/tools-deps/rlwrap.retry b/target/debian-bookworm-21/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-21/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-22/tools-deps/Dockerfile b/target/debian-bookworm-22/tools-deps/Dockerfile index b6f506f2..31bae835 100644 --- a/target/debian-bookworm-22/tools-deps/Dockerfile +++ b/target/debian-bookworm-22/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-22/tools-deps/clj.sh b/target/debian-bookworm-22/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-22/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-22/tools-deps/rlwrap.retry b/target/debian-bookworm-22/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-22/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bookworm-8/tools-deps/Dockerfile index 777ee3b7..baaed989 100644 --- a/target/debian-bookworm-8/tools-deps/Dockerfile +++ b/target/debian-bookworm-8/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bookworm-8/tools-deps/clj.sh b/target/debian-bookworm-8/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-8/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-8/tools-deps/rlwrap.retry b/target/debian-bookworm-8/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-8/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bookworm-slim-11/tools-deps/Dockerfile index 5f8c741d..c799183b 100644 --- a/target/debian-bookworm-slim-11/tools-deps/Dockerfile +++ b/target/debian-bookworm-slim-11/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bookworm-slim-11/tools-deps/clj.sh b/target/debian-bookworm-slim-11/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-slim-11/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-slim-11/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-11/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-slim-11/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bookworm-slim-17/tools-deps/Dockerfile index 4aad2597..0aba68d5 100644 --- a/target/debian-bookworm-slim-17/tools-deps/Dockerfile +++ b/target/debian-bookworm-slim-17/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-slim-17/tools-deps/clj.sh b/target/debian-bookworm-slim-17/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-slim-17/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-slim-17/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-17/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-slim-17/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bookworm-slim-21/tools-deps/Dockerfile index d88192a6..ac8fd348 100644 --- a/target/debian-bookworm-slim-21/tools-deps/Dockerfile +++ b/target/debian-bookworm-slim-21/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-slim-21/tools-deps/clj.sh b/target/debian-bookworm-slim-21/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-slim-21/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-slim-21/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-21/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-slim-21/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-22/tools-deps/Dockerfile b/target/debian-bookworm-slim-22/tools-deps/Dockerfile index 9ad2cd59..d7117bc2 100644 --- a/target/debian-bookworm-slim-22/tools-deps/Dockerfile +++ b/target/debian-bookworm-slim-22/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bookworm-slim-22/tools-deps/clj.sh b/target/debian-bookworm-slim-22/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-slim-22/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-slim-22/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-22/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-slim-22/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bookworm-slim-8/tools-deps/Dockerfile index 12164e98..57893ff2 100644 --- a/target/debian-bookworm-slim-8/tools-deps/Dockerfile +++ b/target/debian-bookworm-slim-8/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bookworm-slim-8/tools-deps/clj.sh b/target/debian-bookworm-slim-8/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bookworm-slim-8/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bookworm-slim-8/tools-deps/rlwrap.retry b/target/debian-bookworm-slim-8/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bookworm-slim-8/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-11/tools-deps/Dockerfile b/target/debian-bullseye-11/tools-deps/Dockerfile index 6b5a1e1e..9765b6b3 100644 --- a/target/debian-bullseye-11/tools-deps/Dockerfile +++ b/target/debian-bullseye-11/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bullseye-11/tools-deps/clj.sh b/target/debian-bullseye-11/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-11/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-11/tools-deps/rlwrap.retry b/target/debian-bullseye-11/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-11/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-17/tools-deps/Dockerfile b/target/debian-bullseye-17/tools-deps/Dockerfile index 176b2792..ad137814 100644 --- a/target/debian-bullseye-17/tools-deps/Dockerfile +++ b/target/debian-bullseye-17/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bullseye-17/tools-deps/clj.sh b/target/debian-bullseye-17/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-17/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-17/tools-deps/rlwrap.retry b/target/debian-bullseye-17/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-17/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bullseye-21/tools-deps/Dockerfile index 9326e92d..e99a1b2d 100644 --- a/target/debian-bullseye-21/tools-deps/Dockerfile +++ b/target/debian-bullseye-21/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bullseye-21/tools-deps/clj.sh b/target/debian-bullseye-21/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-21/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-21/tools-deps/rlwrap.retry b/target/debian-bullseye-21/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-21/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-22/tools-deps/Dockerfile b/target/debian-bullseye-22/tools-deps/Dockerfile index 97fcd812..68bb540f 100644 --- a/target/debian-bullseye-22/tools-deps/Dockerfile +++ b/target/debian-bullseye-22/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bullseye-22/tools-deps/clj.sh b/target/debian-bullseye-22/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-22/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-22/tools-deps/rlwrap.retry b/target/debian-bullseye-22/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-22/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-8/tools-deps/Dockerfile b/target/debian-bullseye-8/tools-deps/Dockerfile index 4daee8f9..8e2ff68a 100644 --- a/target/debian-bullseye-8/tools-deps/Dockerfile +++ b/target/debian-bullseye-8/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bullseye-8/tools-deps/clj.sh b/target/debian-bullseye-8/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-8/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-8/tools-deps/rlwrap.retry b/target/debian-bullseye-8/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-8/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-11/tools-deps/Dockerfile b/target/debian-bullseye-slim-11/tools-deps/Dockerfile index 50d94454..63b86b36 100644 --- a/target/debian-bullseye-slim-11/tools-deps/Dockerfile +++ b/target/debian-bullseye-slim-11/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bullseye-slim-11/tools-deps/clj.sh b/target/debian-bullseye-slim-11/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-slim-11/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-slim-11/tools-deps/rlwrap.retry b/target/debian-bullseye-slim-11/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-slim-11/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-17/tools-deps/Dockerfile b/target/debian-bullseye-slim-17/tools-deps/Dockerfile index 28dac307..f2516eb2 100644 --- a/target/debian-bullseye-slim-17/tools-deps/Dockerfile +++ b/target/debian-bullseye-slim-17/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bullseye-slim-17/tools-deps/clj.sh b/target/debian-bullseye-slim-17/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-slim-17/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-slim-17/tools-deps/rlwrap.retry b/target/debian-bullseye-slim-17/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-slim-17/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/debian-bullseye-slim-21/tools-deps/Dockerfile index 4412f8c1..159d4dc5 100644 --- a/target/debian-bullseye-slim-21/tools-deps/Dockerfile +++ b/target/debian-bullseye-slim-21/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bullseye-slim-21/tools-deps/clj.sh b/target/debian-bullseye-slim-21/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-slim-21/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-slim-21/tools-deps/rlwrap.retry b/target/debian-bullseye-slim-21/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-slim-21/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-22/tools-deps/Dockerfile b/target/debian-bullseye-slim-22/tools-deps/Dockerfile index 895f0d20..d48c4c31 100644 --- a/target/debian-bullseye-slim-22/tools-deps/Dockerfile +++ b/target/debian-bullseye-slim-22/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/debian-bullseye-slim-22/tools-deps/clj.sh b/target/debian-bullseye-slim-22/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-slim-22/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-slim-22/tools-deps/rlwrap.retry b/target/debian-bullseye-slim-22/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-slim-22/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-8/tools-deps/Dockerfile b/target/debian-bullseye-slim-8/tools-deps/Dockerfile index fecf3639..6afaabd2 100644 --- a/target/debian-bullseye-slim-8/tools-deps/Dockerfile +++ b/target/debian-bullseye-slim-8/tools-deps/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \ clojure -e "(clojure-version)" && \ apt-get purge -y --auto-remove 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/debian-bullseye-slim-8/tools-deps/clj.sh b/target/debian-bullseye-slim-8/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/debian-bullseye-slim-8/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/debian-bullseye-slim-8/tools-deps/rlwrap.retry b/target/debian-bullseye-slim-8/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/debian-bullseye-slim-8/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-11-jdk-alpine/tools-deps/Dockerfile b/target/eclipse-temurin-11-jdk-alpine/tools-deps/Dockerfile index aaefb7b5..badc7f37 100644 --- a/target/eclipse-temurin-11-jdk-alpine/tools-deps/Dockerfile +++ b/target/eclipse-temurin-11-jdk-alpine/tools-deps/Dockerfile @@ -15,9 +15,7 @@ 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/eclipse-temurin-11-jdk-alpine/tools-deps/clj.sh b/target/eclipse-temurin-11-jdk-alpine/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-11-jdk-alpine/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-11-jdk-alpine/tools-deps/rlwrap.retry b/target/eclipse-temurin-11-jdk-alpine/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-11-jdk-alpine/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-11-jdk-focal/tools-deps/Dockerfile b/target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile index df5ac2ba..f3ff0be4 100644 --- a/target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile +++ b/target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,9 +16,7 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/eclipse-temurin-11-jdk-focal/tools-deps/clj.sh b/target/eclipse-temurin-11-jdk-focal/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-11-jdk-focal/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-11-jdk-focal/tools-deps/rlwrap.retry b/target/eclipse-temurin-11-jdk-focal/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-11-jdk-focal/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-11-jdk-jammy/tools-deps/Dockerfile b/target/eclipse-temurin-11-jdk-jammy/tools-deps/Dockerfile index 9b53c7d0..6289c7df 100644 --- a/target/eclipse-temurin-11-jdk-jammy/tools-deps/Dockerfile +++ b/target/eclipse-temurin-11-jdk-jammy/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,9 +16,7 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/eclipse-temurin-11-jdk-jammy/tools-deps/clj.sh b/target/eclipse-temurin-11-jdk-jammy/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-11-jdk-jammy/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-11-jdk-jammy/tools-deps/rlwrap.retry b/target/eclipse-temurin-11-jdk-jammy/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-11-jdk-jammy/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-alpine/tools-deps/Dockerfile b/target/eclipse-temurin-17-jdk-alpine/tools-deps/Dockerfile index fc758f39..beeceb36 100644 --- a/target/eclipse-temurin-17-jdk-alpine/tools-deps/Dockerfile +++ b/target/eclipse-temurin-17-jdk-alpine/tools-deps/Dockerfile @@ -15,10 +15,8 @@ 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-17-jdk-alpine/tools-deps/clj.sh b/target/eclipse-temurin-17-jdk-alpine/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-17-jdk-alpine/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-17-jdk-alpine/tools-deps/rlwrap.retry b/target/eclipse-temurin-17-jdk-alpine/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-17-jdk-alpine/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-focal/tools-deps/Dockerfile b/target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile index 56e5e6b9..1e9ff563 100644 --- a/target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile +++ b/target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,10 +16,8 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-17-jdk-focal/tools-deps/clj.sh b/target/eclipse-temurin-17-jdk-focal/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-17-jdk-focal/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-17-jdk-focal/tools-deps/rlwrap.retry b/target/eclipse-temurin-17-jdk-focal/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-17-jdk-focal/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/eclipse-temurin-17-jdk-jammy/tools-deps/Dockerfile index 9e6ba548..3b2734bd 100644 --- a/target/eclipse-temurin-17-jdk-jammy/tools-deps/Dockerfile +++ b/target/eclipse-temurin-17-jdk-jammy/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,10 +16,8 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-17-jdk-jammy/tools-deps/clj.sh b/target/eclipse-temurin-17-jdk-jammy/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-17-jdk-jammy/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-17-jdk-jammy/tools-deps/rlwrap.retry b/target/eclipse-temurin-17-jdk-jammy/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-17-jdk-jammy/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile index 83e31e50..bc473513 100644 --- a/target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile +++ b/target/eclipse-temurin-21-jdk-alpine/tools-deps/Dockerfile @@ -15,10 +15,8 @@ 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-21-jdk-alpine/tools-deps/clj.sh b/target/eclipse-temurin-21-jdk-alpine/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-21-jdk-alpine/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry b/target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-21-jdk-alpine/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile index 0f975af9..0ad3570e 100644 --- a/target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile +++ b/target/eclipse-temurin-21-jdk-jammy/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,10 +16,8 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-21-jdk-jammy/tools-deps/clj.sh b/target/eclipse-temurin-21-jdk-jammy/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-21-jdk-jammy/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry b/target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-21-jdk-jammy/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-22-jdk-alpine/tools-deps/Dockerfile b/target/eclipse-temurin-22-jdk-alpine/tools-deps/Dockerfile index 35a947cc..04558ae8 100644 --- a/target/eclipse-temurin-22-jdk-alpine/tools-deps/Dockerfile +++ b/target/eclipse-temurin-22-jdk-alpine/tools-deps/Dockerfile @@ -15,10 +15,8 @@ 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-22-jdk-alpine/tools-deps/clj.sh b/target/eclipse-temurin-22-jdk-alpine/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-22-jdk-alpine/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-22-jdk-alpine/tools-deps/rlwrap.retry b/target/eclipse-temurin-22-jdk-alpine/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-22-jdk-alpine/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-22-jdk-jammy/tools-deps/Dockerfile b/target/eclipse-temurin-22-jdk-jammy/tools-deps/Dockerfile index ae6a1e1e..a9e43be6 100644 --- a/target/eclipse-temurin-22-jdk-jammy/tools-deps/Dockerfile +++ b/target/eclipse-temurin-22-jdk-jammy/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,10 +16,8 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj COPY entrypoint /usr/local/bin/entrypoint diff --git a/target/eclipse-temurin-22-jdk-jammy/tools-deps/clj.sh b/target/eclipse-temurin-22-jdk-jammy/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-22-jdk-jammy/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-22-jdk-jammy/tools-deps/rlwrap.retry b/target/eclipse-temurin-22-jdk-jammy/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-22-jdk-jammy/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-alpine/tools-deps/Dockerfile b/target/eclipse-temurin-8-jdk-alpine/tools-deps/Dockerfile index 2bc521eb..dfe0922b 100644 --- a/target/eclipse-temurin-8-jdk-alpine/tools-deps/Dockerfile +++ b/target/eclipse-temurin-8-jdk-alpine/tools-deps/Dockerfile @@ -15,9 +15,7 @@ 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/eclipse-temurin-8-jdk-alpine/tools-deps/clj.sh b/target/eclipse-temurin-8-jdk-alpine/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-8-jdk-alpine/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-8-jdk-alpine/tools-deps/rlwrap.retry b/target/eclipse-temurin-8-jdk-alpine/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-8-jdk-alpine/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/tools-deps/Dockerfile b/target/eclipse-temurin-8-jdk-focal/tools-deps/Dockerfile index e87147bf..90b91a16 100644 --- a/target/eclipse-temurin-8-jdk-focal/tools-deps/Dockerfile +++ b/target/eclipse-temurin-8-jdk-focal/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,9 +16,7 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/eclipse-temurin-8-jdk-focal/tools-deps/clj.sh b/target/eclipse-temurin-8-jdk-focal/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-8-jdk-focal/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-8-jdk-focal/tools-deps/rlwrap.retry b/target/eclipse-temurin-8-jdk-focal/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-8-jdk-focal/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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-jammy/tools-deps/Dockerfile b/target/eclipse-temurin-8-jdk-jammy/tools-deps/Dockerfile index 57434f3d..1ba54b62 100644 --- a/target/eclipse-temurin-8-jdk-jammy/tools-deps/Dockerfile +++ b/target/eclipse-temurin-8-jdk-jammy/tools-deps/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /tmp RUN \ apt-get update && \ -apt-get install -y curl make git rlwrap && \ +apt-get install -y curl make git rlfe && \ rm -rf /var/lib/apt/lists/* && \ curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \ sha256sum linux-install-$CLOJURE_VERSION.sh && \ @@ -16,9 +16,7 @@ chmod +x 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 +# Custom "clj" script that uses rlfe instead of rlwrap +COPY clj.sh /usr/local/bin/clj CMD ["clj"] diff --git a/target/eclipse-temurin-8-jdk-jammy/tools-deps/clj.sh b/target/eclipse-temurin-8-jdk-jammy/tools-deps/clj.sh new file mode 100755 index 00000000..429c3a7c --- /dev/null +++ b/target/eclipse-temurin-8-jdk-jammy/tools-deps/clj.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# This script acts as a replacement for "clj" script shipped with Clojure CLI +# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script +# and provide line editing abilities. This script uses rlfe instead of rlwrap +# for the same purpose. If rlfe is not installed, run regular "clojure" script. + +if type rlfe; then + exec rlfe clojure "$@" +else + exec clojure "$@" +fi diff --git a/target/eclipse-temurin-8-jdk-jammy/tools-deps/rlwrap.retry b/target/eclipse-temurin-8-jdk-jammy/tools-deps/rlwrap.retry deleted file mode 100755 index 83cefbfb..00000000 --- a/target/eclipse-temurin-8-jdk-jammy/tools-deps/rlwrap.retry +++ /dev/null @@ -1,30 +0,0 @@ -#!/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