Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clojure image #11375

Merged
merged 3 commits into from
Dec 2, 2021
Merged

Conversation

cap10morgan
Copy link
Contributor

This changes a few things:

  • Makes openjdk-17 the new default base image since it's the new LTS Java release
  • Cleans up the consistency of the tags so that they all conform to what we've long been claiming about them (e.g. slim-bullseye as the default distro everywhere)
  • Uses the various build tools as ENTRYPOINTs (but still allows for docker run -ti image bash) in openjdk-17+ images (still uses CMDs in older ones)
  • Uses clj as the ENTRYPOINT in clojure:latest instead of lein
  • Uses clj as the ENTRYPOINT instead of lein in all images that don't specify a built tool

...since it's the new LTS Java release and clean up the consistency of the tags a bit.

This updated source repo commit also does the following:

- Uses the various build tools as ENTRYPOINTs (but still allows for `docker run -ti image bash`) in openjdk-17+ images (still uses CMDs in older ones)
- Uses clj as the ENTRYPOINT in latest instead of leiningen
...as it is the official first party one and is what newcomers would expect to find. We have long recommended that those who want leiningen use a tag containing "lein" to make sure they get it rather than relying on it being the default.
@yosifkit
Copy link
Member

RUN chmod +x /usr/local/bin/entrypoint

Each RUN that modifies the files from a COPY is creating another copy of the file in the image layers; although it is small, it is best practice to not cause duplication. chmod +x can be tracked in git so that the file will have the correct execute permissions when checked out.


COPY rlwrap.retry /usr/bin/rlwrap.retry
RUN mv /usr/bin/rlwrap /usr/bin/rlwrap.real && \
mv /usr/bin/rlwrap.retry /usr/bin/rlwrap && \
chmod +x /usr/bin/rlwrap

This is similar to the above, any RUN changing files already in the image is creating duplication in the image. It might be simplified by just putting rlwrap.retry as /usr/local/bin/rlwrap (since that is earlier in the PATH) and having it call the real one as /usr/bin/rlwrap.

Something like this?

COPY rlwrap.retry /usr/local/bin/rlwrap

# or some clever symlinks too
COPY rlwrap.retry /usr/local/bin/rlwrap.retry
RUN ln -s /usr/bin/rlwrap /usr/local/bin/rlwrap.real && \
	ln -s /usr/local/bin/rlwrap.retry /usr/local/bin/rlwrap

clojure:openjdk-18-alpine
Step 6/10 : RUN mv /usr/bin/rlwrap /usr/bin/rlwrap.real && mv /usr/bin/rlwrap.retry /usr/bin/rlwrap && chmod +x /usr/bin/rlwrap
---> Running in 37960e2ae7a6
mv: can't rename '/usr/bin/rlwrap': No such file or directory

The openjdk:18-alpine image is based on Alpine 3.14 but that doesn't have an rlwrap executable available until the next alpine release (currently in edge).

@cap10morgan
Copy link
Contributor Author

Hopefully a rebuild on top of the new alpine3.15-based openjdk images will rectify that rlwrap missing error. I'll address the other feedback shortly. Thanks!

@cap10morgan
Copy link
Contributor Author

OK hopefully everything is addressed now

@github-actions
Copy link

Diff for 0ae84e4:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 3d77dfe..f07e95a 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,131 +1,125 @@
 Maintainers: Paul Lam <paul@quantisan.com> (@Quantisan), Wes Morgan <wes@wesmorgan.me> (@cap10morgan)
 Architectures: amd64, arm64v8
 GitRepo: https://github.com/Quantisan/docker-clojure.git
-GitCommit: 09f93abaab24abff0988c80cab1d35e17156d7b4
+GitCommit: 813917fbfab83a6ae37f09c9d5a7bf4acb704896
 
 Tags: latest
-Directory: target/openjdk-11-slim-bullseye/latest
+Directory: target/openjdk-17-slim-bullseye/latest
 
-Tags: openjdk-8, openjdk-8-lein, openjdk-8-lein-2.9.8, openjdk-8-bullseye, openjdk-8-lein-bullseye, openjdk-8-lein-2.9.8-bullseye
-Architectures: amd64
-Directory: target/openjdk-8-bullseye/lein
+Tags: openjdk-8, openjdk-8-slim-bullseye, openjdk-8-tools-deps, openjdk-8-tools-deps-1.10.3.1020, openjdk-8-tools-deps-slim-bullseye, openjdk-8-tools-deps-1.10.3.1020-slim-bullseye
+Directory: target/openjdk-8-slim-bullseye/tools-deps
 
-Tags: openjdk-8-boot, openjdk-8-boot-2.8.3, openjdk-8-boot-bullseye, openjdk-8-boot-2.8.3-bullseye
-Architectures: amd64
+Tags: openjdk-8-boot, openjdk-8-boot-2.8.3, openjdk-8-boot-slim-bullseye, openjdk-8-boot-2.8.3-slim-bullseye
+Directory: target/openjdk-8-slim-bullseye/boot
+
+Tags: openjdk-8-boot-bullseye, openjdk-8-boot-2.8.3-bullseye
 Directory: target/openjdk-8-bullseye/boot
 
 Tags: openjdk-8-boot-buster, openjdk-8-boot-2.8.3-buster
 Directory: target/openjdk-8-buster/boot
 
-Tags: openjdk-8-boot-slim-bullseye, openjdk-8-boot-2.8.3-slim-bullseye
-Architectures: amd64
-Directory: target/openjdk-8-slim-bullseye/boot
-
 Tags: openjdk-8-boot-slim-buster, openjdk-8-boot-2.8.3-slim-buster
 Directory: target/openjdk-8-slim-buster/boot
 
-Tags: openjdk-8-buster, openjdk-8-lein-buster, openjdk-8-lein-2.9.8-buster
-Directory: target/openjdk-8-buster/lein
+Tags: openjdk-8-bullseye, openjdk-8-tools-deps-bullseye, openjdk-8-tools-deps-1.10.3.1020-bullseye
+Directory: target/openjdk-8-bullseye/tools-deps
 
-Tags: openjdk-8-slim-bullseye, openjdk-8-lein-slim-bullseye, openjdk-8-lein-2.9.8-slim-bullseye
-Architectures: amd64
-Directory: target/openjdk-8-slim-bullseye/lein
+Tags: openjdk-8-buster, openjdk-8-tools-deps-buster, openjdk-8-tools-deps-1.10.3.1020-buster
+Directory: target/openjdk-8-buster/tools-deps
 
-Tags: openjdk-8-slim-buster, openjdk-8-lein-slim-buster, openjdk-8-lein-2.9.8-slim-buster
-Directory: target/openjdk-8-slim-buster/lein
+Tags: openjdk-8-lein, openjdk-8-lein-2.9.8, openjdk-8-lein-slim-bullseye, openjdk-8-lein-2.9.8-slim-bullseye
+Directory: target/openjdk-8-slim-bullseye/lein
 
-Tags: openjdk-8-tools-deps, openjdk-8-tools-deps-1.10.3.1020, openjdk-8-tools-deps-bullseye, openjdk-8-tools-deps-1.10.3.1020-bullseye
-Architectures: amd64
-Directory: target/openjdk-8-bullseye/tools-deps
+Tags: openjdk-8-lein-bullseye, openjdk-8-lein-2.9.8-bullseye
+Directory: target/openjdk-8-bullseye/lein
 
-Tags: openjdk-8-tools-deps-buster, openjdk-8-tools-deps-1.10.3.1020-buster
-Directory: target/openjdk-8-buster/tools-deps
+Tags: openjdk-8-lein-buster, openjdk-8-lein-2.9.8-buster
+Directory: target/openjdk-8-buster/lein
 
-Tags: openjdk-8-tools-deps-slim-bullseye, openjdk-8-tools-deps-1.10.3.1020-slim-bullseye
-Architectures: amd64
-Directory: target/openjdk-8-slim-bullseye/tools-deps
+Tags: openjdk-8-lein-slim-buster, openjdk-8-lein-2.9.8-slim-buster
+Directory: target/openjdk-8-slim-buster/lein
 
-Tags: openjdk-8-tools-deps-slim-buster, openjdk-8-tools-deps-1.10.3.1020-slim-buster
+Tags: openjdk-8-slim-buster, openjdk-8-tools-deps-slim-buster, openjdk-8-tools-deps-1.10.3.1020-slim-buster
 Directory: target/openjdk-8-slim-buster/tools-deps
 
-Tags: openjdk-11, openjdk-11-lein, openjdk-11-lein-2.9.8, lein, lein-2.9.8, openjdk-11-bullseye, openjdk-11-lein-bullseye, openjdk-11-lein-2.9.8-bullseye, lein-bullseye, lein-2.9.8-bullseye
-Directory: target/openjdk-11-bullseye/lein
+Tags: openjdk-11, openjdk-11-slim-bullseye, openjdk-11-tools-deps, openjdk-11-tools-deps-1.10.3.1020, openjdk-11-tools-deps-slim-bullseye, openjdk-11-tools-deps-1.10.3.1020-slim-bullseye
+Directory: target/openjdk-11-slim-bullseye/tools-deps
 
-Tags: openjdk-11-boot, openjdk-11-boot-2.8.3, boot, boot-2.8.3, openjdk-11-boot-bullseye, openjdk-11-boot-2.8.3-bullseye, boot-bullseye, boot-2.8.3-bullseye
+Tags: openjdk-11-boot, openjdk-11-boot-2.8.3, openjdk-11-boot-slim-bullseye, openjdk-11-boot-2.8.3-slim-bullseye
+Directory: target/openjdk-11-slim-bullseye/boot
+
+Tags: openjdk-11-boot-bullseye, openjdk-11-boot-2.8.3-bullseye
 Directory: target/openjdk-11-bullseye/boot
 
-Tags: openjdk-11-boot-buster, openjdk-11-boot-2.8.3-buster, boot-buster, boot-2.8.3-buster
+Tags: openjdk-11-boot-buster, openjdk-11-boot-2.8.3-buster
 Directory: target/openjdk-11-buster/boot
 
-Tags: openjdk-11-boot-slim-bullseye, openjdk-11-boot-2.8.3-slim-bullseye, boot-slim-bullseye, boot-2.8.3-slim-bullseye
-Directory: target/openjdk-11-slim-bullseye/boot
-
-Tags: openjdk-11-boot-slim-buster, openjdk-11-boot-2.8.3-slim-buster, boot-slim-buster, boot-2.8.3-slim-buster
+Tags: openjdk-11-boot-slim-buster, openjdk-11-boot-2.8.3-slim-buster
 Directory: target/openjdk-11-slim-buster/boot
 
-Tags: openjdk-11-buster, openjdk-11-lein-buster, openjdk-11-lein-2.9.8-buster, lein-buster, lein-2.9.8-buster
-Directory: target/openjdk-11-buster/lein
+Tags: openjdk-11-bullseye, openjdk-11-tools-deps-bullseye, openjdk-11-tools-deps-1.10.3.1020-bullseye
+Directory: target/openjdk-11-bullseye/tools-deps
 
-Tags: openjdk-11-lein-slim-bullseye, openjdk-11-slim-bullseye, openjdk-11-lein-2.9.8-slim-bullseye, slim-bullseye, lein-slim-bullseye, lein-2.9.8-slim-bullseye
-Directory: target/openjdk-11-slim-bullseye/lein
+Tags: openjdk-11-buster, openjdk-11-tools-deps-buster, openjdk-11-tools-deps-1.10.3.1020-buster
+Directory: target/openjdk-11-buster/tools-deps
 
-Tags: openjdk-11-lein-slim-buster, openjdk-11-slim-buster, openjdk-11-lein-2.9.8-slim-buster, slim-buster, lein-slim-buster, lein-2.9.8-slim-buster
-Directory: target/openjdk-11-slim-buster/lein
+Tags: openjdk-11-lein, openjdk-11-lein-2.9.8, openjdk-11-lein-slim-bullseye, openjdk-11-lein-2.9.8-slim-bullseye
+Directory: target/openjdk-11-slim-bullseye/lein
 
-Tags: openjdk-11-tools-deps, openjdk-11-tools-deps-1.10.3.1020, tools-deps, tools-deps-1.10.3.1020, openjdk-11-tools-deps-bullseye, openjdk-11-tools-deps-1.10.3.1020-bullseye, tools-deps-bullseye, tools-deps-1.10.3.1020-bullseye
-Directory: target/openjdk-11-bullseye/tools-deps
+Tags: openjdk-11-lein-bullseye, openjdk-11-lein-2.9.8-bullseye
+Directory: target/openjdk-11-bullseye/lein
 
-Tags: openjdk-11-tools-deps-buster, openjdk-11-tools-deps-1.10.3.1020-buster, tools-deps-buster, tools-deps-1.10.3.1020-buster
-Directory: target/openjdk-11-buster/tools-deps
+Tags: openjdk-11-lein-buster, openjdk-11-lein-2.9.8-buster
+Directory: target/openjdk-11-buster/lein
 
-Tags: openjdk-11-tools-deps-slim-bullseye, openjdk-11-tools-deps-1.10.3.1020-slim-bullseye, tools-deps-1.10.3.1020-slim-bullseye, tools-deps-slim-bullseye
-Directory: target/openjdk-11-slim-bullseye/tools-deps
+Tags: openjdk-11-lein-slim-buster, openjdk-11-lein-2.9.8-slim-buster
+Directory: target/openjdk-11-slim-buster/lein
 
-Tags: openjdk-11-tools-deps-slim-buster, openjdk-11-tools-deps-1.10.3.1020-slim-buster, tools-deps-1.10.3.1020-slim-buster, tools-deps-slim-buster
+Tags: openjdk-11-slim-buster, openjdk-11-tools-deps-slim-buster, openjdk-11-tools-deps-1.10.3.1020-slim-buster
 Directory: target/openjdk-11-slim-buster/tools-deps
 
-Tags: openjdk-17, openjdk-17-lein, openjdk-17-lein-2.9.8, openjdk-17-slim-bullseye, openjdk-17-lein-slim-bullseye, openjdk-17-lein-2.9.8-slim-bullseye
-Directory: target/openjdk-17-slim-bullseye/lein
+Tags: openjdk-17, openjdk-17-slim-bullseye, tools-deps, tools-deps-1.10.3.1020, openjdk-17-tools-deps, openjdk-17-tools-deps-1.10.3.1020, openjdk-17-tools-deps-slim-bullseye, openjdk-17-tools-deps-1.10.3.1020-slim-bullseye
+Directory: target/openjdk-17-slim-bullseye/tools-deps
 
-Tags: openjdk-17-boot, openjdk-17-boot-2.8.3, openjdk-17-boot-slim-bullseye, openjdk-17-boot-2.8.3-slim-bullseye
+Tags: openjdk-17-boot, openjdk-17-boot-2.8.3, openjdk-17-boot-slim-bullseye, openjdk-17-boot-2.8.3-slim-bullseye, boot, boot-2.8.3, boot-slim-bullseye, boot-2.8.3-slim-bullseye
 Directory: target/openjdk-17-slim-bullseye/boot
 
-Tags: openjdk-17-boot-bullseye, openjdk-17-boot-2.8.3-bullseye
+Tags: openjdk-17-boot-bullseye, openjdk-17-boot-2.8.3-bullseye, boot-bullseye, boot-2.8.3-bullseye
 Directory: target/openjdk-17-bullseye/boot
 
-Tags: openjdk-17-boot-buster, openjdk-17-boot-2.8.3-buster
+Tags: openjdk-17-boot-buster, openjdk-17-boot-2.8.3-buster, boot-buster, boot-2.8.3-buster
 Directory: target/openjdk-17-buster/boot
 
-Tags: openjdk-17-boot-slim-buster, openjdk-17-boot-2.8.3-slim-buster
+Tags: openjdk-17-boot-slim-buster, openjdk-17-boot-2.8.3-slim-buster, boot-slim-buster, boot-2.8.3-slim-buster
 Directory: target/openjdk-17-slim-buster/boot
 
-Tags: openjdk-17-bullseye, openjdk-17-lein-bullseye, openjdk-17-lein-2.9.8-bullseye
-Directory: target/openjdk-17-bullseye/lein
+Tags: openjdk-17-bullseye, openjdk-17-tools-deps-bullseye, openjdk-17-tools-deps-1.10.3.1020-bullseye, tools-deps-bullseye, tools-deps-1.10.3.1020-bullseye
+Directory: target/openjdk-17-bullseye/tools-deps
 
-Tags: openjdk-17-buster, openjdk-17-lein-buster, openjdk-17-lein-2.9.8-buster
-Directory: target/openjdk-17-buster/lein
+Tags: openjdk-17-buster, openjdk-17-tools-deps-buster, openjdk-17-tools-deps-1.10.3.1020-buster, tools-deps-buster, tools-deps-1.10.3.1020-buster
+Directory: target/openjdk-17-buster/tools-deps
 
-Tags: openjdk-17-slim-buster, openjdk-17-lein-slim-buster, openjdk-17-lein-2.9.8-slim-buster
-Directory: target/openjdk-17-slim-buster/lein
+Tags: openjdk-17-lein, openjdk-17-lein-2.9.8, openjdk-17-lein-slim-bullseye, openjdk-17-lein-2.9.8-slim-bullseye, lein-slim-bullseye, lein-2.9.8-slim-bullseye, lein, lein-2.9.8
+Directory: target/openjdk-17-slim-bullseye/lein
 
-Tags: openjdk-17-tools-deps, openjdk-17-tools-deps-1.10.3.1020, openjdk-17-tools-deps-slim-bullseye, openjdk-17-tools-deps-1.10.3.1020-slim-bullseye
-Directory: target/openjdk-17-slim-bullseye/tools-deps
+Tags: openjdk-17-lein-bullseye, openjdk-17-lein-2.9.8-bullseye, lein-bullseye, lein-2.9.8-bullseye
+Directory: target/openjdk-17-bullseye/lein
 
-Tags: openjdk-17-tools-deps-bullseye, openjdk-17-tools-deps-1.10.3.1020-bullseye
-Directory: target/openjdk-17-bullseye/tools-deps
+Tags: openjdk-17-lein-buster, openjdk-17-lein-2.9.8-buster, lein-buster, lein-2.9.8-buster
+Directory: target/openjdk-17-buster/lein
 
-Tags: openjdk-17-tools-deps-buster, openjdk-17-tools-deps-1.10.3.1020-buster
-Directory: target/openjdk-17-buster/tools-deps
+Tags: openjdk-17-lein-slim-buster, openjdk-17-lein-2.9.8-slim-buster, lein-slim-buster, lein-2.9.8-slim-buster
+Directory: target/openjdk-17-slim-buster/lein
 
-Tags: openjdk-17-tools-deps-slim-buster, openjdk-17-tools-deps-1.10.3.1020-slim-buster
+Tags: openjdk-17-slim-buster, openjdk-17-tools-deps-slim-buster, openjdk-17-tools-deps-1.10.3.1020-slim-buster, tools-deps-1.10.3.1020-slim-buster, tools-deps-slim-buster
 Directory: target/openjdk-17-slim-buster/tools-deps
 
-Tags: openjdk-18, openjdk-18-lein, openjdk-18-lein-2.9.8, openjdk-18-slim-bullseye, openjdk-18-lein-slim-bullseye, openjdk-18-lein-2.9.8-slim-bullseye
-Directory: target/openjdk-18-slim-bullseye/lein
+Tags: openjdk-18, openjdk-18-slim-bullseye, openjdk-18-tools-deps, openjdk-18-tools-deps-1.10.3.1020, openjdk-18-tools-deps-slim-bullseye, openjdk-18-tools-deps-1.10.3.1020-slim-bullseye
+Directory: target/openjdk-18-slim-bullseye/tools-deps
 
-Tags: openjdk-18-alpine, openjdk-18-lein-alpine, openjdk-18-lein-2.9.8-alpine
+Tags: openjdk-18-alpine, openjdk-18-tools-deps-alpine, openjdk-18-tools-deps-1.10.3.1020-alpine
 Architectures: amd64
-Directory: target/openjdk-18-alpine/lein
+Directory: target/openjdk-18-alpine/tools-deps
 
 Tags: openjdk-18-boot, openjdk-18-boot-2.8.3, openjdk-18-boot-slim-bullseye, openjdk-18-boot-2.8.3-slim-bullseye
 Directory: target/openjdk-18-slim-bullseye/boot
@@ -143,27 +137,27 @@ Directory: target/openjdk-18-buster/boot
 Tags: openjdk-18-boot-slim-buster, openjdk-18-boot-2.8.3-slim-buster
 Directory: target/openjdk-18-slim-buster/boot
 
-Tags: openjdk-18-bullseye, openjdk-18-lein-bullseye, openjdk-18-lein-2.9.8-bullseye
-Directory: target/openjdk-18-bullseye/lein
-
-Tags: openjdk-18-buster, openjdk-18-lein-buster, openjdk-18-lein-2.9.8-buster
-Directory: target/openjdk-18-buster/lein
+Tags: openjdk-18-bullseye, openjdk-18-tools-deps-bullseye, openjdk-18-tools-deps-1.10.3.1020-bullseye
+Directory: target/openjdk-18-bullseye/tools-deps
 
-Tags: openjdk-18-slim-buster, openjdk-18-lein-slim-buster, openjdk-18-lein-2.9.8-slim-buster
-Directory: target/openjdk-18-slim-buster/lein
+Tags: openjdk-18-buster, openjdk-18-tools-deps-buster, openjdk-18-tools-deps-1.10.3.1020-buster
+Directory: target/openjdk-18-buster/tools-deps
 
-Tags: openjdk-18-tools-deps, openjdk-18-tools-deps-1.10.3.1020, openjdk-18-tools-deps-slim-bullseye, openjdk-18-tools-deps-1.10.3.1020-slim-bullseye
-Directory: target/openjdk-18-slim-bullseye/tools-deps
+Tags: openjdk-18-lein, openjdk-18-lein-2.9.8, openjdk-18-lein-slim-bullseye, openjdk-18-lein-2.9.8-slim-bullseye
+Directory: target/openjdk-18-slim-bullseye/lein
 
-Tags: openjdk-18-tools-deps-alpine, openjdk-18-tools-deps-1.10.3.1020-alpine
+Tags: openjdk-18-lein-alpine, openjdk-18-lein-2.9.8-alpine
 Architectures: amd64
-Directory: target/openjdk-18-alpine/tools-deps
+Directory: target/openjdk-18-alpine/lein
 
-Tags: openjdk-18-tools-deps-bullseye, openjdk-18-tools-deps-1.10.3.1020-bullseye
-Directory: target/openjdk-18-bullseye/tools-deps
+Tags: openjdk-18-lein-bullseye, openjdk-18-lein-2.9.8-bullseye
+Directory: target/openjdk-18-bullseye/lein
 
-Tags: openjdk-18-tools-deps-buster, openjdk-18-tools-deps-1.10.3.1020-buster
-Directory: target/openjdk-18-buster/tools-deps
+Tags: openjdk-18-lein-buster, openjdk-18-lein-2.9.8-buster
+Directory: target/openjdk-18-buster/lein
+
+Tags: openjdk-18-lein-slim-buster, openjdk-18-lein-2.9.8-slim-buster
+Directory: target/openjdk-18-slim-buster/lein
 
-Tags: openjdk-18-tools-deps-slim-buster, openjdk-18-tools-deps-1.10.3.1020-slim-buster
+Tags: openjdk-18-slim-buster, openjdk-18-tools-deps-slim-buster, openjdk-18-tools-deps-1.10.3.1020-slim-buster
 Directory: target/openjdk-18-slim-buster/tools-deps
diff --git a/_bashbrew-list b/_bashbrew-list
index 2c06dbd..b9da01f 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -166,15 +166,11 @@ clojure:openjdk-18-tools-deps-bullseye
 clojure:openjdk-18-tools-deps-buster
 clojure:openjdk-18-tools-deps-slim-bullseye
 clojure:openjdk-18-tools-deps-slim-buster
-clojure:slim-bullseye
-clojure:slim-buster
 clojure:tools-deps
 clojure:tools-deps-1.10.3.1020
 clojure:tools-deps-1.10.3.1020-bullseye
 clojure:tools-deps-1.10.3.1020-buster
-clojure:tools-deps-1.10.3.1020-slim-bullseye
 clojure:tools-deps-1.10.3.1020-slim-buster
 clojure:tools-deps-bullseye
 clojure:tools-deps-buster
-clojure:tools-deps-slim-bullseye
 clojure:tools-deps-slim-buster
diff --git a/clojure_boot-2.8.3-bullseye/Dockerfile b/clojure_boot-2.8.3-bullseye/Dockerfile
index e002c0f..55965f6 100644
--- a/clojure_boot-2.8.3-bullseye/Dockerfile
+++ b/clojure_boot-2.8.3-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-bullseye
+FROM openjdk:17-bullseye
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
@@ -22,4 +22,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_boot-2.8.3-bullseye/entrypoint b/clojure_boot-2.8.3-bullseye/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_boot-2.8.3-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_boot-2.8.3-buster/Dockerfile b/clojure_boot-2.8.3-buster/Dockerfile
index dbc5b40..d469a91 100644
--- a/clojure_boot-2.8.3-buster/Dockerfile
+++ b/clojure_boot-2.8.3-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-buster
+FROM openjdk:17-buster
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
@@ -22,4 +22,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_boot-2.8.3-buster/entrypoint b/clojure_boot-2.8.3-buster/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_boot-2.8.3-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_boot-2.8.3-slim-bullseye/Dockerfile b/clojure_boot-2.8.3-slim-bullseye/Dockerfile
index 66409f9..58d4390 100644
--- a/clojure_boot-2.8.3-slim-bullseye/Dockerfile
+++ b/clojure_boot-2.8.3-slim-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-slim-bullseye
+FROM openjdk:17-slim-bullseye
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
@@ -26,4 +26,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_boot-2.8.3-slim-bullseye/entrypoint b/clojure_boot-2.8.3-slim-bullseye/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_boot-2.8.3-slim-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_boot-2.8.3-slim-buster/Dockerfile b/clojure_boot-2.8.3-slim-buster/Dockerfile
index 3f08057..a0e692d 100644
--- a/clojure_boot-2.8.3-slim-buster/Dockerfile
+++ b/clojure_boot-2.8.3-slim-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-slim-buster
+FROM openjdk:17-slim-buster
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
@@ -26,4 +26,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_boot-2.8.3-slim-buster/entrypoint b/clojure_boot-2.8.3-slim-buster/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_boot-2.8.3-slim-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_latest/Dockerfile b/clojure_latest/Dockerfile
index 1452327..757f695 100644
--- a/clojure_latest/Dockerfile
+++ b/clojure_latest/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-slim-bullseye
+FROM openjdk:17-slim-bullseye
 
 ### INSTALL BOOT ###
 ENV BOOT_VERSION=2.8.3
@@ -88,4 +88,13 @@ rm linux-install-$CLOJURE_VERSION.sh && \
 clojure -e "(clojure-version)" && \
 apt-get purge -y --auto-remove curl wget
 
-CMD ["lein", "repl"]
\ No newline at end of file
+# Docker bug makes rlwrap crash w/o short sleep first
+# Bug: https://github.com/moby/moby/issues/28009
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+
+CMD ["repl"]
diff --git a/clojure_latest/entrypoint b/clojure_latest/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_latest/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_latest/rlwrap.retry b/clojure_latest/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_latest/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_lein-2.9.8-bullseye/Dockerfile b/clojure_lein-2.9.8-bullseye/Dockerfile
index dd7fac0..b16d9a1 100644
--- a/clojure_lein-2.9.8-bullseye/Dockerfile
+++ b/clojure_lein-2.9.8-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-bullseye
+FROM openjdk:17-bullseye
 
 ENV LEIN_VERSION=2.9.8
 ENV LEIN_INSTALL=/usr/local/bin/
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_lein-2.9.8-bullseye/entrypoint b/clojure_lein-2.9.8-bullseye/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_lein-2.9.8-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_lein-2.9.8-buster/Dockerfile b/clojure_lein-2.9.8-buster/Dockerfile
index adc48e5..0006f7a 100644
--- a/clojure_lein-2.9.8-buster/Dockerfile
+++ b/clojure_lein-2.9.8-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-buster
+FROM openjdk:17-buster
 
 ENV LEIN_VERSION=2.9.8
 ENV LEIN_INSTALL=/usr/local/bin/
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_lein-2.9.8-buster/entrypoint b/clojure_lein-2.9.8-buster/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_lein-2.9.8-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_lein-2.9.8-slim-buster/Dockerfile b/clojure_lein-2.9.8-slim-buster/Dockerfile
index 8e3bf0b..ba92dd8 100644
--- a/clojure_lein-2.9.8-slim-buster/Dockerfile
+++ b/clojure_lein-2.9.8-slim-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-slim-buster
+FROM openjdk:17-slim-buster
 
 ENV LEIN_VERSION=2.9.8
 ENV LEIN_INSTALL=/usr/local/bin/
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_lein-2.9.8-slim-buster/entrypoint b/clojure_lein-2.9.8-slim-buster/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_lein-2.9.8-slim-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-17-lein-2.9.8-slim-bullseye/Dockerfile b/clojure_lein-2.9.8/Dockerfile
similarity index 96%
rename from clojure_openjdk-17-lein-2.9.8-slim-bullseye/Dockerfile
rename to clojure_lein-2.9.8/Dockerfile
index 132608f..1aabcb0 100644
--- a/clojure_openjdk-17-lein-2.9.8-slim-bullseye/Dockerfile
+++ b/clojure_lein-2.9.8/Dockerfile
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_lein-2.9.8/entrypoint b/clojure_lein-2.9.8/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_lein-2.9.8/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-17-boot-2.8.3-bullseye/Dockerfile b/clojure_openjdk-11-boot-2.8.3-bullseye/Dockerfile
similarity index 93%
rename from clojure_openjdk-17-boot-2.8.3-bullseye/Dockerfile
rename to clojure_openjdk-11-boot-2.8.3-bullseye/Dockerfile
index 1b40d8e..68d155f 100644
--- a/clojure_openjdk-17-boot-2.8.3-bullseye/Dockerfile
+++ b/clojure_openjdk-11-boot-2.8.3-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-bullseye
+FROM openjdk:11-bullseye
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
diff --git a/clojure_openjdk-17-boot-2.8.3-buster/Dockerfile b/clojure_openjdk-11-boot-2.8.3-buster/Dockerfile
similarity index 93%
rename from clojure_openjdk-17-boot-2.8.3-buster/Dockerfile
rename to clojure_openjdk-11-boot-2.8.3-buster/Dockerfile
index d32c466..12af794 100644
--- a/clojure_openjdk-17-boot-2.8.3-buster/Dockerfile
+++ b/clojure_openjdk-11-boot-2.8.3-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-buster
+FROM openjdk:11-buster
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
diff --git a/clojure_openjdk-17-boot-2.8.3-slim-bullseye/Dockerfile b/clojure_openjdk-11-boot-2.8.3-slim-bullseye/Dockerfile
similarity index 94%
rename from clojure_openjdk-17-boot-2.8.3-slim-bullseye/Dockerfile
rename to clojure_openjdk-11-boot-2.8.3-slim-bullseye/Dockerfile
index 83090bd..f5d14a2 100644
--- a/clojure_openjdk-17-boot-2.8.3-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-11-boot-2.8.3-slim-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-slim-bullseye
+FROM openjdk:11-slim-bullseye
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
diff --git a/clojure_openjdk-17-boot-2.8.3-slim-buster/Dockerfile b/clojure_openjdk-11-boot-2.8.3-slim-buster/Dockerfile
similarity index 94%
rename from clojure_openjdk-17-boot-2.8.3-slim-buster/Dockerfile
rename to clojure_openjdk-11-boot-2.8.3-slim-buster/Dockerfile
index 30f4200..da4f342 100644
--- a/clojure_openjdk-17-boot-2.8.3-slim-buster/Dockerfile
+++ b/clojure_openjdk-11-boot-2.8.3-slim-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-slim-buster
+FROM openjdk:11-slim-buster
 
 ENV BOOT_VERSION=2.8.3
 ENV BOOT_INSTALL=/usr/local/bin/
diff --git a/clojure_openjdk-17-lein-2.9.8-bullseye/Dockerfile b/clojure_openjdk-11-lein-2.9.8-bullseye/Dockerfile
similarity index 97%
rename from clojure_openjdk-17-lein-2.9.8-bullseye/Dockerfile
rename to clojure_openjdk-11-lein-2.9.8-bullseye/Dockerfile
index 78d2734..1768c95 100644
--- a/clojure_openjdk-17-lein-2.9.8-bullseye/Dockerfile
+++ b/clojure_openjdk-11-lein-2.9.8-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-bullseye
+FROM openjdk:11-bullseye
 
 ENV LEIN_VERSION=2.9.8
 ENV LEIN_INSTALL=/usr/local/bin/
diff --git a/clojure_openjdk-17-lein-2.9.8-buster/Dockerfile b/clojure_openjdk-11-lein-2.9.8-buster/Dockerfile
similarity index 97%
rename from clojure_openjdk-17-lein-2.9.8-buster/Dockerfile
rename to clojure_openjdk-11-lein-2.9.8-buster/Dockerfile
index 2181e2e..28afcc5 100644
--- a/clojure_openjdk-17-lein-2.9.8-buster/Dockerfile
+++ b/clojure_openjdk-11-lein-2.9.8-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-buster
+FROM openjdk:11-buster
 
 ENV LEIN_VERSION=2.9.8
 ENV LEIN_INSTALL=/usr/local/bin/
diff --git a/clojure_lein-2.9.8-slim-bullseye/Dockerfile b/clojure_openjdk-11-lein-2.9.8-slim-bullseye/Dockerfile
similarity index 98%
rename from clojure_lein-2.9.8-slim-bullseye/Dockerfile
rename to clojure_openjdk-11-lein-2.9.8-slim-bullseye/Dockerfile
index 74d92e8..87809f6 100644
diff --git a/clojure_openjdk-17-lein-2.9.8-slim-buster/Dockerfile b/clojure_openjdk-11-lein-2.9.8-slim-buster/Dockerfile
similarity index 97%
rename from clojure_openjdk-17-lein-2.9.8-slim-buster/Dockerfile
rename to clojure_openjdk-11-lein-2.9.8-slim-buster/Dockerfile
index 476d567..a8922e8 100644
--- a/clojure_openjdk-17-lein-2.9.8-slim-buster/Dockerfile
+++ b/clojure_openjdk-11-lein-2.9.8-slim-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-slim-buster
+FROM openjdk:11-slim-buster
 
 ENV LEIN_VERSION=2.9.8
 ENV LEIN_INSTALL=/usr/local/bin/
diff --git a/clojure_openjdk-17-tools-deps-1.10.3.1020-buster/Dockerfile b/clojure_openjdk-11-tools-deps-1.10.3.1020-bullseye/Dockerfile
similarity index 81%
rename from clojure_openjdk-17-tools-deps-1.10.3.1020-buster/Dockerfile
rename to clojure_openjdk-11-tools-deps-1.10.3.1020-bullseye/Dockerfile
index 8e52ed9..32a3096 100644
--- a/clojure_openjdk-17-tools-deps-1.10.3.1020-buster/Dockerfile
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-buster
+FROM openjdk:11-bullseye
 
 ENV CLOJURE_VERSION=1.10.3.1020
 
@@ -18,5 +18,7 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-11-tools-deps-1.10.3.1020-bullseye/rlwrap.retry b/clojure_openjdk-11-tools-deps-1.10.3.1020-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-17-tools-deps-1.10.3.1020-bullseye/Dockerfile b/clojure_openjdk-11-tools-deps-1.10.3.1020-buster/Dockerfile
similarity index 81%
rename from clojure_openjdk-17-tools-deps-1.10.3.1020-bullseye/Dockerfile
rename to clojure_openjdk-11-tools-deps-1.10.3.1020-buster/Dockerfile
index f0fb21e..d603f8b 100644
--- a/clojure_openjdk-17-tools-deps-1.10.3.1020-bullseye/Dockerfile
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-bullseye
+FROM openjdk:11-buster
 
 ENV CLOJURE_VERSION=1.10.3.1020
 
@@ -18,5 +18,7 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-11-tools-deps-1.10.3.1020-buster/rlwrap.retry b/clojure_openjdk-11-tools-deps-1.10.3.1020-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_tools-deps-slim-bullseye/Dockerfile b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
similarity index 85%
rename from clojure_tools-deps-slim-bullseye/Dockerfile
rename to clojure_openjdk-11-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
index d79cbc0..1510344 100644
--- a/clojure_tools-deps-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
@@ -19,5 +19,7 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_tools-deps-slim-buster/Dockerfile b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-buster/Dockerfile
similarity index 85%
copy from clojure_tools-deps-slim-buster/Dockerfile
copy to clojure_openjdk-11-tools-deps-1.10.3.1020-slim-buster/Dockerfile
index d5c755b..bbf69cf 100644
--- a/clojure_tools-deps-slim-buster/Dockerfile
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-buster/Dockerfile
@@ -19,5 +19,7 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-11-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
index 1892d3b..afef14b 100644
--- a/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
@@ -19,5 +19,10 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/entrypoint b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-buster/Dockerfile b/clojure_openjdk-17-tools-deps-1.10.3.1020-slim-buster/Dockerfile
deleted file mode 100644
index ee91eae..0000000
diff --git a/clojure_openjdk-18-boot-2.8.3-alpine/Dockerfile b/clojure_openjdk-18-boot-2.8.3-alpine/Dockerfile
index 40670d5..fa8c78d 100644
--- a/clojure_openjdk-18-boot-2.8.3-alpine/Dockerfile
+++ b/clojure_openjdk-18-boot-2.8.3-alpine/Dockerfile
@@ -24,4 +24,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-boot-2.8.3-alpine/entrypoint b/clojure_openjdk-18-boot-2.8.3-alpine/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_openjdk-18-boot-2.8.3-alpine/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-boot-2.8.3-bullseye/Dockerfile b/clojure_openjdk-18-boot-2.8.3-bullseye/Dockerfile
index 4f9cd93..f5599ec 100644
--- a/clojure_openjdk-18-boot-2.8.3-bullseye/Dockerfile
+++ b/clojure_openjdk-18-boot-2.8.3-bullseye/Dockerfile
@@ -22,4 +22,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-boot-2.8.3-bullseye/entrypoint b/clojure_openjdk-18-boot-2.8.3-bullseye/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_openjdk-18-boot-2.8.3-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-boot-2.8.3-buster/Dockerfile b/clojure_openjdk-18-boot-2.8.3-buster/Dockerfile
index 324bc48..c5c5aed 100644
--- a/clojure_openjdk-18-boot-2.8.3-buster/Dockerfile
+++ b/clojure_openjdk-18-boot-2.8.3-buster/Dockerfile
@@ -22,4 +22,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-boot-2.8.3-buster/entrypoint b/clojure_openjdk-18-boot-2.8.3-buster/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_openjdk-18-boot-2.8.3-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-boot-2.8.3-slim-bullseye/Dockerfile b/clojure_openjdk-18-boot-2.8.3-slim-bullseye/Dockerfile
index 505d1e9..78b822f 100644
--- a/clojure_openjdk-18-boot-2.8.3-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-18-boot-2.8.3-slim-bullseye/Dockerfile
@@ -26,4 +26,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-boot-2.8.3-slim-bullseye/entrypoint b/clojure_openjdk-18-boot-2.8.3-slim-bullseye/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_openjdk-18-boot-2.8.3-slim-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-boot-2.8.3-slim-buster/Dockerfile b/clojure_openjdk-18-boot-2.8.3-slim-buster/Dockerfile
index f2c2b74..be32cf2 100644
--- a/clojure_openjdk-18-boot-2.8.3-slim-buster/Dockerfile
+++ b/clojure_openjdk-18-boot-2.8.3-slim-buster/Dockerfile
@@ -26,4 +26,7 @@ ENV BOOT_AS_ROOT=yes
 
 RUN boot
 
-CMD ["boot", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-boot-2.8.3-slim-buster/entrypoint b/clojure_openjdk-18-boot-2.8.3-slim-buster/entrypoint
new file mode 100755
index 0000000..2fe7257
--- /dev/null
+++ b/clojure_openjdk-18-boot-2.8.3-slim-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=boot
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-lein-2.9.8-alpine/Dockerfile b/clojure_openjdk-18-lein-2.9.8-alpine/Dockerfile
index 9e87682..8ec343c 100644
--- a/clojure_openjdk-18-lein-2.9.8-alpine/Dockerfile
+++ b/clojure_openjdk-18-lein-2.9.8-alpine/Dockerfile
@@ -40,4 +40,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-lein-2.9.8-alpine/entrypoint b/clojure_openjdk-18-lein-2.9.8-alpine/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_openjdk-18-lein-2.9.8-alpine/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-lein-2.9.8-bullseye/Dockerfile b/clojure_openjdk-18-lein-2.9.8-bullseye/Dockerfile
index 244ded8..ab97f91 100644
--- a/clojure_openjdk-18-lein-2.9.8-bullseye/Dockerfile
+++ b/clojure_openjdk-18-lein-2.9.8-bullseye/Dockerfile
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-lein-2.9.8-bullseye/entrypoint b/clojure_openjdk-18-lein-2.9.8-bullseye/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_openjdk-18-lein-2.9.8-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-lein-2.9.8-buster/Dockerfile b/clojure_openjdk-18-lein-2.9.8-buster/Dockerfile
index 011cbd3..90272fb 100644
--- a/clojure_openjdk-18-lein-2.9.8-buster/Dockerfile
+++ b/clojure_openjdk-18-lein-2.9.8-buster/Dockerfile
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-lein-2.9.8-buster/entrypoint b/clojure_openjdk-18-lein-2.9.8-buster/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_openjdk-18-lein-2.9.8-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-lein-2.9.8-slim-bullseye/Dockerfile b/clojure_openjdk-18-lein-2.9.8-slim-bullseye/Dockerfile
index 76ae84a..a7e052e 100644
--- a/clojure_openjdk-18-lein-2.9.8-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-18-lein-2.9.8-slim-bullseye/Dockerfile
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-lein-2.9.8-slim-bullseye/entrypoint b/clojure_openjdk-18-lein-2.9.8-slim-bullseye/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_openjdk-18-lein-2.9.8-slim-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-lein-2.9.8-slim-buster/Dockerfile b/clojure_openjdk-18-lein-2.9.8-slim-buster/Dockerfile
index 5d66e0f..f545cce 100644
--- a/clojure_openjdk-18-lein-2.9.8-slim-buster/Dockerfile
+++ b/clojure_openjdk-18-lein-2.9.8-slim-buster/Dockerfile
@@ -42,4 +42,7 @@ ENV LEIN_ROOT 1
 RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.10.3"]])' > project.clj \
   && lein deps && rm project.clj
 
-CMD ["lein", "repl"]
\ No newline at end of file
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["repl"]
diff --git a/clojure_openjdk-18-lein-2.9.8-slim-buster/entrypoint b/clojure_openjdk-18-lein-2.9.8-slim-buster/entrypoint
new file mode 100755
index 0000000..ccf8cce
--- /dev/null
+++ b/clojure_openjdk-18-lein-2.9.8-slim-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=lein
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/Dockerfile b/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/Dockerfile
index 49f16ae..88c11ff 100644
--- a/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/Dockerfile
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/Dockerfile
@@ -17,5 +17,10 @@ apk del curl
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/entrypoint b/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/rlwrap.retry b/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-alpine/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/Dockerfile b/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/Dockerfile
index 74ee02a..0241452 100644
--- a/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/Dockerfile
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/Dockerfile
@@ -18,5 +18,10 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/entrypoint b/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/rlwrap.retry b/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/Dockerfile b/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/Dockerfile
index bcc6ff9..0847129 100644
--- a/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/Dockerfile
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/Dockerfile
@@ -18,5 +18,10 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/entrypoint b/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/rlwrap.retry b/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
index b746810..d7a88a2 100644
--- a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
@@ -19,5 +19,10 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/entrypoint b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/Dockerfile b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/Dockerfile
index a9771a8..a3d3d05 100644
--- a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/Dockerfile
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/Dockerfile
@@ -19,5 +19,10 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/entrypoint b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-18-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/Dockerfile b/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/Dockerfile
index a2f0c40..fb763f1 100644
--- a/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/Dockerfile
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/Dockerfile
@@ -18,5 +18,7 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/rlwrap.retry b/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/Dockerfile b/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/Dockerfile
index 51f71d5..53ca10f 100644
--- a/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/Dockerfile
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/Dockerfile
@@ -18,5 +18,7 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/rlwrap.retry b/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
index c3aff27..b22a1ed 100644
--- a/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/Dockerfile
@@ -19,5 +19,7 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/Dockerfile b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/Dockerfile
index 5cba4e1..6488098 100644
--- a/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/Dockerfile
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/Dockerfile
@@ -19,5 +19,7 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+CMD ["clj"]
diff --git a/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_openjdk-8-tools-deps-1.10.3.1020-slim-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_tools-deps-1.10.3.1020-bullseye/Dockerfile b/clojure_tools-deps-1.10.3.1020-bullseye/Dockerfile
index 02b5b83..70d17d4 100644
--- a/clojure_tools-deps-1.10.3.1020-bullseye/Dockerfile
+++ b/clojure_tools-deps-1.10.3.1020-bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-bullseye
+FROM openjdk:17-bullseye
 
 ENV CLOJURE_VERSION=1.10.3.1020
 
@@ -18,5 +18,10 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_tools-deps-1.10.3.1020-bullseye/entrypoint b/clojure_tools-deps-1.10.3.1020-bullseye/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_tools-deps-1.10.3.1020-bullseye/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_tools-deps-1.10.3.1020-bullseye/rlwrap.retry b/clojure_tools-deps-1.10.3.1020-bullseye/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_tools-deps-1.10.3.1020-bullseye/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_tools-deps-1.10.3.1020-buster/Dockerfile b/clojure_tools-deps-1.10.3.1020-buster/Dockerfile
index f9d286f..51f687f 100644
--- a/clojure_tools-deps-1.10.3.1020-buster/Dockerfile
+++ b/clojure_tools-deps-1.10.3.1020-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-buster
+FROM openjdk:17-buster
 
 ENV CLOJURE_VERSION=1.10.3.1020
 
@@ -18,5 +18,10 @@ clojure -e "(clojure-version)"
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_tools-deps-1.10.3.1020-buster/entrypoint b/clojure_tools-deps-1.10.3.1020-buster/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_tools-deps-1.10.3.1020-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_tools-deps-1.10.3.1020-buster/rlwrap.retry b/clojure_tools-deps-1.10.3.1020-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_tools-deps-1.10.3.1020-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done
diff --git a/clojure_tools-deps-slim-buster/Dockerfile b/clojure_tools-deps-slim-buster/Dockerfile
index d5c755b..53f7a92 100644
--- a/clojure_tools-deps-slim-buster/Dockerfile
+++ b/clojure_tools-deps-slim-buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11-slim-buster
+FROM openjdk:17-slim-buster
 
 ENV CLOJURE_VERSION=1.10.3.1020
 
@@ -19,5 +19,10 @@ apt-get purge -y --auto-remove curl wget
 
 # Docker bug makes rlwrap crash w/o short sleep first
 # Bug: https://github.com/moby/moby/issues/28009
-# As of 2019-10-2 this bug still exists, despite that issue being closed
-CMD ["sh", "-c", "sleep 1 && exec clj"]
\ No newline at end of file
+# As of 2021-09-10 this bug still exists, despite that issue being closed
+COPY rlwrap.retry /usr/local/bin/rlwrap
+
+COPY entrypoint /usr/local/bin/entrypoint
+
+ENTRYPOINT ["entrypoint"]
+CMD ["-M", "--repl"]
diff --git a/clojure_tools-deps-slim-buster/entrypoint b/clojure_tools-deps-slim-buster/entrypoint
new file mode 100755
index 0000000..51561d1
--- /dev/null
+++ b/clojure_tools-deps-slim-buster/entrypoint
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -eou pipefail
+
+entrypoint=clj
+
+cmd=${1:-}
+
+# check if the first arg starts with a hyphen
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+  exec "${entrypoint}" "$@"
+fi
+
+if [[ -n "${cmd}" ]]; then
+  # see if help for the subcommand is successful
+  if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
+    exec "${entrypoint}" "$@"
+  fi
+fi
+
+exec "$@"
diff --git a/clojure_tools-deps-slim-buster/rlwrap.retry b/clojure_tools-deps-slim-buster/rlwrap.retry
new file mode 100755
index 0000000..83cefbf
--- /dev/null
+++ b/clojure_tools-deps-slim-buster/rlwrap.retry
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script works around a Docker bug that prevents rlwrap from starting
+# right when a container is first started. It is intended to replace
+# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
+# (e.g. /usr/local/bin).
+
+max_tries=100 # 100 tries is ~1 second
+try=0
+
+while true; do
+  # see if rlwrap can start at all
+  output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
+  exit_code=$?
+  if [ $exit_code -gt 0 ]; then
+    # it didn't start
+    try=$((try+1))
+    if [ $try -gt $max_tries ]; then
+      # we're at max attempts so output the error and exit w/ the same code
+      echo "$output" >&2
+      exit $exit_code
+    else
+      # wait a bit and try again
+      sleep 0.01
+    fi
+  else
+    # rlwrap can start so let's run it for real
+    exec /usr/bin/rlwrap "$@"
+  fi
+done

Relevant Maintainers:

@tianon tianon merged commit a111d57 into docker-library:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants