Skip to content

Commit

Permalink
Update Dockerfiles with new combined image
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Apr 24, 2024
1 parent de891a4 commit 1ddacc8
Show file tree
Hide file tree
Showing 101 changed files with 2,960 additions and 997 deletions.
43 changes: 26 additions & 17 deletions target/debian-bookworm-11/lein/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,48 @@ ENV PATH="${JAVA_HOME}/bin:${PATH}"

ENV LEIN_VERSION=2.11.2
ENV LEIN_INSTALL=/usr/local/bin/
ENV LEIN_ROOT=1
ENV PATH=$PATH:$LEIN_INSTALL
ENV CLOJURE_CLI_VERSION=1.11.1.1435

WORKDIR /tmp

# Download the whole repo as an archive
RUN set -eux; \
apt-get update && \
apt-get install -y make gnupg wget && \
apt-get install -y curl make git rlwrap gnupg && \
rm -rf /var/lib/apt/lists/* && \
echo Installing Leiningen && \
mkdir -p $LEIN_INSTALL && \
wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
echo "Comparing lein-pkg checksum ..." && \
sha256sum lein-pkg && \
echo "28a1a62668c5f427b413a8677e376affaa995f023b1fcd06e2d4c98ac1df5f3e *lein-pkg" | sha256sum -c - && \
mv lein-pkg $LEIN_INSTALL/lein && \
chmod 0755 $LEIN_INSTALL/lein && \
export GNUPGHOME="$(mktemp -d)" && \
export FILENAME_EXT=jar && \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
echo "Verifying file PGP signature..." && \
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar.asc && \
echo "Verifying Leiningen file PGP signature..." && \
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.jar.asc leiningen-$LEIN_VERSION-standalone.jar && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.jar.asc && \
mkdir -p /usr/share/java && \
mv leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
apt-get purge -y --auto-remove gnupg wget

ENV PATH=$PATH:$LEIN_INSTALL
ENV LEIN_ROOT 1
mv leiningen-$LEIN_VERSION-standalone.jar /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
mkdir -p ~/.lein/ && \
echo Installing tools.deps && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_CLI_VERSION.sh && \
sha256sum linux-install-$CLOJURE_CLI_VERSION.sh && \
echo "7edee5b12197a2dbe6338e672b109b18164cde84bea1f049ceceed41fc4dd10a *linux-install-$CLOJURE_CLI_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_CLI_VERSION.sh && \
./linux-install-$CLOJURE_CLI_VERSION.sh && \
rm linux-install-$CLOJURE_CLI_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl gnupg

# Install clojure 1.11.1 so users don't have to download it every time
RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \
&& lein deps && rm project.clj
# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
# As of 2021-09-10 this bug still exists, despite that issue being closed
COPY rlwrap.retry /usr/local/bin/rlwrap

CMD ["lein", "repl"]
File renamed without changes.
44 changes: 34 additions & 10 deletions target/debian-bookworm-11/tools-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,46 @@ ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"

ENV CLOJURE_VERSION=1.11.1.1435
ENV LEIN_VERSION=2.11.2
ENV LEIN_INSTALL=/usr/local/bin/
ENV LEIN_ROOT=1
ENV PATH=$PATH:$LEIN_INSTALL
ENV CLOJURE_CLI_VERSION=1.11.1.1435

WORKDIR /tmp

RUN \
RUN set -eux; \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlwrap gnupg && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
echo "7edee5b12197a2dbe6338e672b109b18164cde84bea1f049ceceed41fc4dd10a *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_VERSION.sh && \
./linux-install-$CLOJURE_VERSION.sh && \
rm linux-install-$CLOJURE_VERSION.sh && \
echo Installing Leiningen && \
mkdir -p $LEIN_INSTALL && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
echo "Comparing lein-pkg checksum ..." && \
sha256sum lein-pkg && \
echo "28a1a62668c5f427b413a8677e376affaa995f023b1fcd06e2d4c98ac1df5f3e *lein-pkg" | sha256sum -c - && \
mv lein-pkg $LEIN_INSTALL/lein && \
chmod 0755 $LEIN_INSTALL/lein && \
export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar.asc && \
echo "Verifying Leiningen file PGP signature..." && \
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.jar.asc leiningen-$LEIN_VERSION-standalone.jar && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.jar.asc && \
mkdir -p /usr/share/java && \
mv leiningen-$LEIN_VERSION-standalone.jar /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
mkdir -p ~/.lein/ && \
echo Installing tools.deps && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_CLI_VERSION.sh && \
sha256sum linux-install-$CLOJURE_CLI_VERSION.sh && \
echo "7edee5b12197a2dbe6338e672b109b18164cde84bea1f049ceceed41fc4dd10a *linux-install-$CLOJURE_CLI_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_CLI_VERSION.sh && \
./linux-install-$CLOJURE_CLI_VERSION.sh && \
rm linux-install-$CLOJURE_CLI_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl
apt-get purge -y --auto-remove curl gnupg

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
Expand Down
45 changes: 27 additions & 18 deletions target/debian-bookworm-17/lein/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,49 @@ ENV PATH="${JAVA_HOME}/bin:${PATH}"

ENV LEIN_VERSION=2.11.2
ENV LEIN_INSTALL=/usr/local/bin/
ENV LEIN_ROOT=1
ENV PATH=$PATH:$LEIN_INSTALL
ENV CLOJURE_CLI_VERSION=1.11.1.1435

WORKDIR /tmp

# Download the whole repo as an archive
RUN set -eux; \
apt-get update && \
apt-get install -y make gnupg wget && \
apt-get install -y curl make git rlwrap gnupg && \
rm -rf /var/lib/apt/lists/* && \
echo Installing Leiningen && \
mkdir -p $LEIN_INSTALL && \
wget -q https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
echo "Comparing lein-pkg checksum ..." && \
sha256sum lein-pkg && \
echo "28a1a62668c5f427b413a8677e376affaa995f023b1fcd06e2d4c98ac1df5f3e *lein-pkg" | sha256sum -c - && \
mv lein-pkg $LEIN_INSTALL/lein && \
chmod 0755 $LEIN_INSTALL/lein && \
export GNUPGHOME="$(mktemp -d)" && \
export FILENAME_EXT=jar && \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
wget -q https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
echo "Verifying file PGP signature..." && \
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar.asc && \
echo "Verifying Leiningen file PGP signature..." && \
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.jar.asc leiningen-$LEIN_VERSION-standalone.jar && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT.asc && \
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.jar.asc && \
mkdir -p /usr/share/java && \
mv leiningen-$LEIN_VERSION-standalone.$FILENAME_EXT /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
apt-get purge -y --auto-remove gnupg wget

ENV PATH=$PATH:$LEIN_INSTALL
ENV LEIN_ROOT 1

# Install clojure 1.11.1 so users don't have to download it every time
RUN echo '(defproject dummy "" :dependencies [[org.clojure/clojure "1.11.1"]])' > project.clj \
&& lein deps && rm project.clj
mv leiningen-$LEIN_VERSION-standalone.jar /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
mkdir -p ~/.lein/ && \
echo Installing tools.deps && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_CLI_VERSION.sh && \
sha256sum linux-install-$CLOJURE_CLI_VERSION.sh && \
echo "7edee5b12197a2dbe6338e672b109b18164cde84bea1f049ceceed41fc4dd10a *linux-install-$CLOJURE_CLI_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_CLI_VERSION.sh && \
./linux-install-$CLOJURE_CLI_VERSION.sh && \
rm linux-install-$CLOJURE_CLI_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl gnupg

# 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

Expand Down
30 changes: 30 additions & 0 deletions target/debian-bookworm-17/lein/rlwrap.retry
Original file line number Diff line number Diff line change
@@ -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
44 changes: 34 additions & 10 deletions target/debian-bookworm-17/tools-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,46 @@ ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"

ENV CLOJURE_VERSION=1.11.1.1435
ENV LEIN_VERSION=2.11.2
ENV LEIN_INSTALL=/usr/local/bin/
ENV LEIN_ROOT=1
ENV PATH=$PATH:$LEIN_INSTALL
ENV CLOJURE_CLI_VERSION=1.11.1.1435

WORKDIR /tmp

RUN \
RUN set -eux; \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlwrap gnupg && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
echo "7edee5b12197a2dbe6338e672b109b18164cde84bea1f049ceceed41fc4dd10a *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_VERSION.sh && \
./linux-install-$CLOJURE_VERSION.sh && \
rm linux-install-$CLOJURE_VERSION.sh && \
echo Installing Leiningen && \
mkdir -p $LEIN_INSTALL && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/raw/tag/$LEIN_VERSION/bin/lein-pkg && \
echo "Comparing lein-pkg checksum ..." && \
sha256sum lein-pkg && \
echo "28a1a62668c5f427b413a8677e376affaa995f023b1fcd06e2d4c98ac1df5f3e *lein-pkg" | sha256sum -c - && \
mv lein-pkg $LEIN_INSTALL/lein && \
chmod 0755 $LEIN_INSTALL/lein && \
export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys 9D13D9426A0814B3373CF5E3D8A8243577A7859F && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar && \
curl -fsSLO https://codeberg.org/leiningen/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.jar.asc && \
echo "Verifying Leiningen file PGP signature..." && \
gpg --batch --verify leiningen-$LEIN_VERSION-standalone.jar.asc leiningen-$LEIN_VERSION-standalone.jar && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" leiningen-$LEIN_VERSION-standalone.jar.asc && \
mkdir -p /usr/share/java && \
mv leiningen-$LEIN_VERSION-standalone.jar /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
mkdir -p ~/.lein/ && \
echo Installing tools.deps && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_CLI_VERSION.sh && \
sha256sum linux-install-$CLOJURE_CLI_VERSION.sh && \
echo "7edee5b12197a2dbe6338e672b109b18164cde84bea1f049ceceed41fc4dd10a *linux-install-$CLOJURE_CLI_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_CLI_VERSION.sh && \
./linux-install-$CLOJURE_CLI_VERSION.sh && \
rm linux-install-$CLOJURE_CLI_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl
apt-get purge -y --auto-remove curl gnupg

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
Expand Down
73 changes: 0 additions & 73 deletions target/debian-bookworm-21/latest/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions target/debian-bookworm-21/latest/entrypoint

This file was deleted.

Loading

0 comments on commit 1ddacc8

Please sign in to comment.