Skip to content

Commit 0cf2870

Browse files
committed
Add JDK 25 Dockerfiles
1 parent 6e97554 commit 0cf2870

File tree

40 files changed

+1195
-0
lines changed

40 files changed

+1195
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM debian:bookworm
2+
3+
ENV JAVA_HOME=/opt/java/openjdk
4+
COPY --from=eclipse-temurin:25 $JAVA_HOME $JAVA_HOME
5+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
6+
7+
ENV LEIN_VERSION=2.12.0
8+
ENV LEIN_INSTALL=/usr/local/bin/
9+
10+
WORKDIR /tmp
11+
12+
# Download the whole repo as an archive
13+
RUN set -eux; \
14+
apt-get update && \
15+
apt-get install -y make gnupg wget && \
16+
rm -rf /var/lib/apt/lists/* && \
17+
mkdir -p $LEIN_INSTALL && \
18+
wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
19+
echo "Comparing lein-pkg checksum ..." && \
20+
sha256sum lein-pkg && \
21+
echo "12a9c5e3a2471619ca3d64a7462f920fdf713ae8959eb4fcd6257c23332b5aa4 *lein-pkg" | sha256sum -c - && \
22+
mv lein-pkg $LEIN_INSTALL/lein && \
23+
chmod 0755 $LEIN_INSTALL/lein && \
24+
export GNUPGHOME="$(mktemp -d)" && \
25+
export FILENAME_EXT=jar && \
26+
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \
27+
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
28+
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
29+
echo "Verifying file PGP signature..." && \
30+
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
31+
gpgconf --kill all && \
32+
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
33+
mkdir -p /usr/share/java && \
34+
mkdir -p /root/.lein && \
35+
mv leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
36+
apt-get purge -y --auto-remove gnupg wget
37+
38+
ENV PATH=$PATH:$LEIN_INSTALL
39+
ENV LEIN_ROOT 1
40+
41+
# Install clojure 1.12.1 so users don't have to download it every time
42+
RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.12.1"]])' > project.clj \
43+
&& lein deps && rm project.clj
44+
45+
COPY entrypoint /usr/local/bin/entrypoint
46+
47+
ENTRYPOINT ["entrypoint"]
48+
CMD ["repl"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -eou pipefail
4+
5+
entrypoint=lein
6+
7+
cmd=${1:-}
8+
9+
# check if the first arg starts with a hyphen
10+
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
11+
exec "${entrypoint}" "$@"
12+
fi
13+
14+
if [[ -n "${cmd}" ]]; then
15+
# see if help for the subcommand is successful
16+
if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
17+
exec "${entrypoint}" "$@"
18+
fi
19+
fi
20+
21+
exec "$@"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM debian:bookworm
2+
3+
ENV JAVA_HOME=/opt/java/openjdk
4+
COPY --from=eclipse-temurin:25 $JAVA_HOME $JAVA_HOME
5+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
6+
7+
ENV CLOJURE_VERSION=1.12.2.1565
8+
9+
WORKDIR /tmp
10+
11+
RUN \
12+
apt-get update && \
13+
apt-get install -y curl make git rlwrap && \
14+
rm -rf /var/lib/apt/lists/* && \
15+
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
16+
sha256sum linux-install-$CLOJURE_VERSION.sh && \
17+
echo "68442caaeaaa0780957953dfac11278e3991d3baeb22579fc582ed1b2d5cd152 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \
18+
chmod +x linux-install-$CLOJURE_VERSION.sh && \
19+
./linux-install-$CLOJURE_VERSION.sh && \
20+
rm linux-install-$CLOJURE_VERSION.sh && \
21+
clojure -e "(clojure-version)" && \
22+
apt-get purge -y --auto-remove curl
23+
24+
# Docker bug makes rlwrap crash w/o short sleep first
25+
# Bug: https://github.com/moby/moby/issues/28009
26+
# As of 2021-09-10 this bug still exists, despite that issue being closed
27+
COPY rlwrap.retry /usr/local/bin/rlwrap
28+
29+
COPY entrypoint /usr/local/bin/entrypoint
30+
31+
ENTRYPOINT ["entrypoint"]
32+
CMD ["-M", "--repl"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -eou pipefail
4+
5+
entrypoint=clj
6+
7+
cmd=${1:-}
8+
9+
# check if the first arg starts with a hyphen
10+
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
11+
exec "${entrypoint}" "$@"
12+
fi
13+
14+
if [[ -n "${cmd}" ]]; then
15+
# see if help for the subcommand is successful
16+
if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
17+
exec "${entrypoint}" "$@"
18+
fi
19+
fi
20+
21+
exec "$@"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
# This script works around a Docker bug that prevents rlwrap from starting
4+
# right when a container is first started. It is intended to replace
5+
# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
6+
# (e.g. /usr/local/bin).
7+
8+
max_tries=100 # 100 tries is ~1 second
9+
try=0
10+
11+
while true; do
12+
# see if rlwrap can start at all
13+
output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
14+
exit_code=$?
15+
if [ $exit_code -gt 0 ]; then
16+
# it didn't start
17+
try=$((try+1))
18+
if [ $try -gt $max_tries ]; then
19+
# we're at max attempts so output the error and exit w/ the same code
20+
echo "$output" >&2
21+
exit $exit_code
22+
else
23+
# wait a bit and try again
24+
sleep 0.01
25+
fi
26+
else
27+
# rlwrap can start so let's run it for real
28+
exec /usr/bin/rlwrap "$@"
29+
fi
30+
done
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM debian:bookworm-slim
2+
3+
ENV JAVA_HOME=/opt/java/openjdk
4+
COPY --from=eclipse-temurin:25 $JAVA_HOME $JAVA_HOME
5+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
6+
7+
ENV LEIN_VERSION=2.12.0
8+
ENV LEIN_INSTALL=/usr/local/bin/
9+
10+
WORKDIR /tmp
11+
12+
# Download the whole repo as an archive
13+
RUN set -eux; \
14+
apt-get update && \
15+
apt-get install -y gnupg wget && \
16+
rm -rf /var/lib/apt/lists/* && \
17+
mkdir -p $LEIN_INSTALL && \
18+
wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
19+
echo "Comparing lein-pkg checksum ..." && \
20+
sha256sum lein-pkg && \
21+
echo "12a9c5e3a2471619ca3d64a7462f920fdf713ae8959eb4fcd6257c23332b5aa4 *lein-pkg" | sha256sum -c - && \
22+
mv lein-pkg $LEIN_INSTALL/lein && \
23+
chmod 0755 $LEIN_INSTALL/lein && \
24+
export GNUPGHOME="$(mktemp -d)" && \
25+
export FILENAME_EXT=jar && \
26+
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \
27+
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
28+
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
29+
echo "Verifying file PGP signature..." && \
30+
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
31+
gpgconf --kill all && \
32+
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
33+
mkdir -p /usr/share/java && \
34+
mkdir -p /root/.lein && \
35+
mv leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
36+
apt-get purge -y --auto-remove gnupg wget
37+
38+
ENV PATH=$PATH:$LEIN_INSTALL
39+
ENV LEIN_ROOT 1
40+
41+
# Install clojure 1.12.1 so users don't have to download it every time
42+
RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.12.1"]])' > project.clj \
43+
&& lein deps && rm project.clj
44+
45+
COPY entrypoint /usr/local/bin/entrypoint
46+
47+
ENTRYPOINT ["entrypoint"]
48+
CMD ["repl"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -eou pipefail
4+
5+
entrypoint=lein
6+
7+
cmd=${1:-}
8+
9+
# check if the first arg starts with a hyphen
10+
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
11+
exec "${entrypoint}" "$@"
12+
fi
13+
14+
if [[ -n "${cmd}" ]]; then
15+
# see if help for the subcommand is successful
16+
if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
17+
exec "${entrypoint}" "$@"
18+
fi
19+
fi
20+
21+
exec "$@"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM debian:bookworm-slim
2+
3+
ENV JAVA_HOME=/opt/java/openjdk
4+
COPY --from=eclipse-temurin:25 $JAVA_HOME $JAVA_HOME
5+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
6+
7+
ENV CLOJURE_VERSION=1.12.2.1565
8+
9+
WORKDIR /tmp
10+
11+
RUN \
12+
apt-get update && \
13+
apt-get install -y curl make git rlwrap && \
14+
rm -rf /var/lib/apt/lists/* && \
15+
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
16+
sha256sum linux-install-$CLOJURE_VERSION.sh && \
17+
echo "68442caaeaaa0780957953dfac11278e3991d3baeb22579fc582ed1b2d5cd152 *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \
18+
chmod +x linux-install-$CLOJURE_VERSION.sh && \
19+
./linux-install-$CLOJURE_VERSION.sh && \
20+
rm linux-install-$CLOJURE_VERSION.sh && \
21+
clojure -e "(clojure-version)" && \
22+
apt-get purge -y --auto-remove curl
23+
24+
# Docker bug makes rlwrap crash w/o short sleep first
25+
# Bug: https://github.com/moby/moby/issues/28009
26+
# As of 2021-09-10 this bug still exists, despite that issue being closed
27+
COPY rlwrap.retry /usr/local/bin/rlwrap
28+
29+
COPY entrypoint /usr/local/bin/entrypoint
30+
31+
ENTRYPOINT ["entrypoint"]
32+
CMD ["-M", "--repl"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -eou pipefail
4+
5+
entrypoint=clj
6+
7+
cmd=${1:-}
8+
9+
# check if the first arg starts with a hyphen
10+
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
11+
exec "${entrypoint}" "$@"
12+
fi
13+
14+
if [[ -n "${cmd}" ]]; then
15+
# see if help for the subcommand is successful
16+
if "${entrypoint}" "${cmd}" --help >/dev/null 2>&1; then
17+
exec "${entrypoint}" "$@"
18+
fi
19+
fi
20+
21+
exec "$@"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
# This script works around a Docker bug that prevents rlwrap from starting
4+
# right when a container is first started. It is intended to replace
5+
# /usr/bin/rlwrap and also be named rlwrap but earlier in the PATH
6+
# (e.g. /usr/local/bin).
7+
8+
max_tries=100 # 100 tries is ~1 second
9+
try=0
10+
11+
while true; do
12+
# see if rlwrap can start at all
13+
output=$(/usr/bin/rlwrap true 2>&1 >/dev/null)
14+
exit_code=$?
15+
if [ $exit_code -gt 0 ]; then
16+
# it didn't start
17+
try=$((try+1))
18+
if [ $try -gt $max_tries ]; then
19+
# we're at max attempts so output the error and exit w/ the same code
20+
echo "$output" >&2
21+
exit $exit_code
22+
else
23+
# wait a bit and try again
24+
sleep 0.01
25+
fi
26+
else
27+
# rlwrap can start so let's run it for real
28+
exec /usr/bin/rlwrap "$@"
29+
fi
30+
done

0 commit comments

Comments
 (0)