From 868aee64cb2aac936969307f61b9450e7dd98769 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 13 Aug 2026 11:35:48 -0700 Subject: [PATCH] Remove Amazon Linux 2 support (EOL) https://aws.amazon.com/amazon-linux-2/ > Amazon Linux 2 reached end-of-support on June 30, 2026. --- 9.0/jdk11/corretto-al2/Dockerfile | 163 ------------------------------ 9.0/jdk17/corretto-al2/Dockerfile | 163 ------------------------------ 9.0/jdk21/corretto-al2/Dockerfile | 163 ------------------------------ 9.0/jdk8/corretto-al2/Dockerfile | 163 ------------------------------ Dockerfile.template | 64 ------------ from.jq | 4 +- shared.jq | 12 --- versions.json | 6 +- versions.sh | 5 - 9 files changed, 2 insertions(+), 741 deletions(-) delete mode 100644 9.0/jdk11/corretto-al2/Dockerfile delete mode 100644 9.0/jdk17/corretto-al2/Dockerfile delete mode 100644 9.0/jdk21/corretto-al2/Dockerfile delete mode 100644 9.0/jdk8/corretto-al2/Dockerfile diff --git a/9.0/jdk11/corretto-al2/Dockerfile b/9.0/jdk11/corretto-al2/Dockerfile deleted file mode 100644 index a60da3353..000000000 --- a/9.0/jdk11/corretto-al2/Dockerfile +++ /dev/null @@ -1,163 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM amazoncorretto:11-al2-jdk - -ENV CATALINA_HOME /usr/local/tomcat -ENV PATH $CATALINA_HOME/bin:$PATH -RUN mkdir -p "$CATALINA_HOME" -WORKDIR $CATALINA_HOME - -# let "Tomcat Native" live somewhere isolated -ENV TOMCAT_NATIVE_LIBDIR $CATALINA_HOME/native-jni-lib -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOMCAT_NATIVE_LIBDIR - -ENV TOMCAT_MAJOR 9 -ENV TOMCAT_VERSION 9.0.120 -ENV TOMCAT_SHA512 07eb6d9639c3e69af81171a16ccff1c19b7fd5b2e87e3646851f0a3f42a4ce3c1bf128fbe40fc978a08935ba4f0400ef3b43ded3e470b9aaf23b97a9e1fa0858 - -RUN set -eux; \ - \ -# http://yum.baseurl.org/wiki/YumDB.html - if ! command -v yumdb > /dev/null; then \ - yum install -y --setopt=skip_missing_names_on_install=False yum-utils; \ - yumdb set reason dep yum-utils; \ - fi; \ -# a helper function to "yum install" things, but only if they aren't installed (and to set their "reason" to "dep" so "yum autoremove" can purge them for us) - _yum_install_temporary() { ( set -eu +x; \ - local pkg todo=''; \ - for pkg; do \ - if ! rpm --query "$pkg" > /dev/null 2>&1; then \ - todo="$todo $pkg"; \ - fi; \ - done; \ - if [ -n "$todo" ]; then \ - set -x; \ - yum install -y --setopt=skip_missing_names_on_install=False $todo; \ - yumdb set reason dep $todo; \ - fi; \ - ) }; \ - _yum_install_temporary gzip tar; \ - \ - ddist() { \ - local f="$1"; shift; \ - local distFile="$1"; shift; \ - local mvnFile="${1:-}"; \ - local success=; \ - local distUrl=; \ - for distUrl in \ -# https://apache.org/history/mirror-history.html - "https://dlcdn.apache.org/$distFile" \ -# if the version is outdated, we have to pull from the archive - "https://archive.apache.org/dist/$distFile" \ -# if all else fails, let's try Maven (https://www.mail-archive.com/users@tomcat.apache.org/msg134940.html; https://mvnrepository.com/artifact/org.apache.tomcat/tomcat; https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/) - ${mvnFile:+"https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/$mvnFile"} \ - ; do \ - if curl -fL -o "$f" "$distUrl" && [ -s "$f" ]; then \ - success=1; \ - break; \ - fi; \ - done; \ - [ -n "$success" ]; \ - }; \ - \ - ddist 'tomcat.tar.gz' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz"; \ - echo "$TOMCAT_SHA512 *tomcat.tar.gz" | sha512sum --strict --check -; \ - ddist 'tomcat.tar.gz.asc' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz.asc" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - curl -fL -o upstream-KEYS 'https://www.apache.org/dist/tomcat/tomcat-9/KEYS'; \ - gpg --batch --import upstream-KEYS; \ -# filter upstream KEYS file to *just* known/precomputed fingerprints - printf '' > filtered-KEYS; \ -# see https://www.apache.org/dist/tomcat/tomcat-9/KEYS - for key in \ - 'DCFD35E0BF8CA7344752DE8B6FB21E8933C60243' \ - 'A9C5DF4D22E99998D9875A5110C01C5A2F6059E7' \ - '48F8E69F6390C9F25CFEDCD268248959359E722B' \ - ; do \ - gpg --batch --fingerprint "$key"; \ - gpg --batch --export --armor "$key" >> filtered-KEYS; \ - done; \ - rm -rf "$GNUPGHOME"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --import filtered-KEYS; \ - gpg --batch --verify tomcat.tar.gz.asc tomcat.tar.gz; \ - tar -xf tomcat.tar.gz --strip-components=1; \ - rm bin/*.bat; \ - rm tomcat.tar.gz*; \ - rm -rf "$GNUPGHOME"; \ - \ -# https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Default_web_applications - mv webapps webapps.dist; \ - mkdir webapps; \ -# we don't delete them completely because they're frankly a pain to get back for users who do want them, and they're generally tiny (~7MB) - \ - nativeBuildDir="$(mktemp -d)"; \ - tar -xf bin/tomcat-native.tar.gz -C "$nativeBuildDir" --strip-components=1; \ - _yum_install_temporary \ - apr-devel \ - gcc \ - make \ - openssl11-devel \ - ; \ - ( \ - export CATALINA_HOME="$PWD"; \ - cd "$nativeBuildDir/native"; \ - aprConfig="$(command -v apr-1-config)"; \ - ./configure \ - --libdir="$TOMCAT_NATIVE_LIBDIR" \ - --prefix="$CATALINA_HOME" \ - --with-apr="$aprConfig" \ - --with-java-home="$JAVA_HOME" \ - --with-ssl \ - ; \ - nproc="$(nproc)"; \ - make -j "$nproc"; \ - make install; \ - ); \ - rm -rf "$nativeBuildDir"; \ - rm bin/tomcat-native.tar.gz; \ - \ -# mark any explicit dependencies as manually installed - find "$TOMCAT_NATIVE_LIBDIR" -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ && $(NF-1) != "=>" { print $(NF-1) }' \ - | xargs -rt readlink -e \ - | sort -u \ - | xargs -rt rpm --query --whatprovides \ - | sort -u \ - | tee "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt" \ - | xargs -r yumdb set reason user \ - ; \ - \ -# clean up anything added temporarily and not later marked as necessary - yum autoremove -y; \ - yum clean all; \ - rm -rf /var/cache/yum; \ - \ -# sh removes env vars it doesn't support (ones with periods) -# https://github.com/docker-library/tomcat/issues/77 - find ./bin/ -name '*.sh' -exec sed -ri 's|^#!/bin/sh$|#!/usr/bin/env bash|' '{}' +; \ - \ -# fix permissions (especially for running as non-root) -# https://github.com/docker-library/tomcat/issues/35 - chmod -R +rX .; \ - chmod 1777 logs temp work; \ - \ -# smoke test - catalina.sh version - -# verify Tomcat Native is working properly -RUN set -eux; \ - nativeLines="$(catalina.sh configtest 2>&1)"; \ - nativeLines="$(echo "$nativeLines" | grep 'Apache Tomcat Native')"; \ - nativeLines="$(echo "$nativeLines" | sort -u)"; \ - if ! echo "$nativeLines" | grep -E 'INFO: Loaded( APR based)? Apache Tomcat Native library' >&2; then \ - echo >&2 "$nativeLines"; \ - exit 1; \ - fi - -EXPOSE 8080 -CMD ["catalina.sh", "run"] diff --git a/9.0/jdk17/corretto-al2/Dockerfile b/9.0/jdk17/corretto-al2/Dockerfile deleted file mode 100644 index 9d7fa4a38..000000000 --- a/9.0/jdk17/corretto-al2/Dockerfile +++ /dev/null @@ -1,163 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM amazoncorretto:17-al2-jdk - -ENV CATALINA_HOME /usr/local/tomcat -ENV PATH $CATALINA_HOME/bin:$PATH -RUN mkdir -p "$CATALINA_HOME" -WORKDIR $CATALINA_HOME - -# let "Tomcat Native" live somewhere isolated -ENV TOMCAT_NATIVE_LIBDIR $CATALINA_HOME/native-jni-lib -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOMCAT_NATIVE_LIBDIR - -ENV TOMCAT_MAJOR 9 -ENV TOMCAT_VERSION 9.0.120 -ENV TOMCAT_SHA512 07eb6d9639c3e69af81171a16ccff1c19b7fd5b2e87e3646851f0a3f42a4ce3c1bf128fbe40fc978a08935ba4f0400ef3b43ded3e470b9aaf23b97a9e1fa0858 - -RUN set -eux; \ - \ -# http://yum.baseurl.org/wiki/YumDB.html - if ! command -v yumdb > /dev/null; then \ - yum install -y --setopt=skip_missing_names_on_install=False yum-utils; \ - yumdb set reason dep yum-utils; \ - fi; \ -# a helper function to "yum install" things, but only if they aren't installed (and to set their "reason" to "dep" so "yum autoremove" can purge them for us) - _yum_install_temporary() { ( set -eu +x; \ - local pkg todo=''; \ - for pkg; do \ - if ! rpm --query "$pkg" > /dev/null 2>&1; then \ - todo="$todo $pkg"; \ - fi; \ - done; \ - if [ -n "$todo" ]; then \ - set -x; \ - yum install -y --setopt=skip_missing_names_on_install=False $todo; \ - yumdb set reason dep $todo; \ - fi; \ - ) }; \ - _yum_install_temporary gzip tar; \ - \ - ddist() { \ - local f="$1"; shift; \ - local distFile="$1"; shift; \ - local mvnFile="${1:-}"; \ - local success=; \ - local distUrl=; \ - for distUrl in \ -# https://apache.org/history/mirror-history.html - "https://dlcdn.apache.org/$distFile" \ -# if the version is outdated, we have to pull from the archive - "https://archive.apache.org/dist/$distFile" \ -# if all else fails, let's try Maven (https://www.mail-archive.com/users@tomcat.apache.org/msg134940.html; https://mvnrepository.com/artifact/org.apache.tomcat/tomcat; https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/) - ${mvnFile:+"https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/$mvnFile"} \ - ; do \ - if curl -fL -o "$f" "$distUrl" && [ -s "$f" ]; then \ - success=1; \ - break; \ - fi; \ - done; \ - [ -n "$success" ]; \ - }; \ - \ - ddist 'tomcat.tar.gz' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz"; \ - echo "$TOMCAT_SHA512 *tomcat.tar.gz" | sha512sum --strict --check -; \ - ddist 'tomcat.tar.gz.asc' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz.asc" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - curl -fL -o upstream-KEYS 'https://www.apache.org/dist/tomcat/tomcat-9/KEYS'; \ - gpg --batch --import upstream-KEYS; \ -# filter upstream KEYS file to *just* known/precomputed fingerprints - printf '' > filtered-KEYS; \ -# see https://www.apache.org/dist/tomcat/tomcat-9/KEYS - for key in \ - 'DCFD35E0BF8CA7344752DE8B6FB21E8933C60243' \ - 'A9C5DF4D22E99998D9875A5110C01C5A2F6059E7' \ - '48F8E69F6390C9F25CFEDCD268248959359E722B' \ - ; do \ - gpg --batch --fingerprint "$key"; \ - gpg --batch --export --armor "$key" >> filtered-KEYS; \ - done; \ - rm -rf "$GNUPGHOME"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --import filtered-KEYS; \ - gpg --batch --verify tomcat.tar.gz.asc tomcat.tar.gz; \ - tar -xf tomcat.tar.gz --strip-components=1; \ - rm bin/*.bat; \ - rm tomcat.tar.gz*; \ - rm -rf "$GNUPGHOME"; \ - \ -# https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Default_web_applications - mv webapps webapps.dist; \ - mkdir webapps; \ -# we don't delete them completely because they're frankly a pain to get back for users who do want them, and they're generally tiny (~7MB) - \ - nativeBuildDir="$(mktemp -d)"; \ - tar -xf bin/tomcat-native.tar.gz -C "$nativeBuildDir" --strip-components=1; \ - _yum_install_temporary \ - apr-devel \ - gcc \ - make \ - openssl11-devel \ - ; \ - ( \ - export CATALINA_HOME="$PWD"; \ - cd "$nativeBuildDir/native"; \ - aprConfig="$(command -v apr-1-config)"; \ - ./configure \ - --libdir="$TOMCAT_NATIVE_LIBDIR" \ - --prefix="$CATALINA_HOME" \ - --with-apr="$aprConfig" \ - --with-java-home="$JAVA_HOME" \ - --with-ssl \ - ; \ - nproc="$(nproc)"; \ - make -j "$nproc"; \ - make install; \ - ); \ - rm -rf "$nativeBuildDir"; \ - rm bin/tomcat-native.tar.gz; \ - \ -# mark any explicit dependencies as manually installed - find "$TOMCAT_NATIVE_LIBDIR" -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ && $(NF-1) != "=>" { print $(NF-1) }' \ - | xargs -rt readlink -e \ - | sort -u \ - | xargs -rt rpm --query --whatprovides \ - | sort -u \ - | tee "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt" \ - | xargs -r yumdb set reason user \ - ; \ - \ -# clean up anything added temporarily and not later marked as necessary - yum autoremove -y; \ - yum clean all; \ - rm -rf /var/cache/yum; \ - \ -# sh removes env vars it doesn't support (ones with periods) -# https://github.com/docker-library/tomcat/issues/77 - find ./bin/ -name '*.sh' -exec sed -ri 's|^#!/bin/sh$|#!/usr/bin/env bash|' '{}' +; \ - \ -# fix permissions (especially for running as non-root) -# https://github.com/docker-library/tomcat/issues/35 - chmod -R +rX .; \ - chmod 1777 logs temp work; \ - \ -# smoke test - catalina.sh version - -# verify Tomcat Native is working properly -RUN set -eux; \ - nativeLines="$(catalina.sh configtest 2>&1)"; \ - nativeLines="$(echo "$nativeLines" | grep 'Apache Tomcat Native')"; \ - nativeLines="$(echo "$nativeLines" | sort -u)"; \ - if ! echo "$nativeLines" | grep -E 'INFO: Loaded( APR based)? Apache Tomcat Native library' >&2; then \ - echo >&2 "$nativeLines"; \ - exit 1; \ - fi - -EXPOSE 8080 -CMD ["catalina.sh", "run"] diff --git a/9.0/jdk21/corretto-al2/Dockerfile b/9.0/jdk21/corretto-al2/Dockerfile deleted file mode 100644 index daec46f03..000000000 --- a/9.0/jdk21/corretto-al2/Dockerfile +++ /dev/null @@ -1,163 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM amazoncorretto:21-al2-jdk - -ENV CATALINA_HOME /usr/local/tomcat -ENV PATH $CATALINA_HOME/bin:$PATH -RUN mkdir -p "$CATALINA_HOME" -WORKDIR $CATALINA_HOME - -# let "Tomcat Native" live somewhere isolated -ENV TOMCAT_NATIVE_LIBDIR $CATALINA_HOME/native-jni-lib -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOMCAT_NATIVE_LIBDIR - -ENV TOMCAT_MAJOR 9 -ENV TOMCAT_VERSION 9.0.120 -ENV TOMCAT_SHA512 07eb6d9639c3e69af81171a16ccff1c19b7fd5b2e87e3646851f0a3f42a4ce3c1bf128fbe40fc978a08935ba4f0400ef3b43ded3e470b9aaf23b97a9e1fa0858 - -RUN set -eux; \ - \ -# http://yum.baseurl.org/wiki/YumDB.html - if ! command -v yumdb > /dev/null; then \ - yum install -y --setopt=skip_missing_names_on_install=False yum-utils; \ - yumdb set reason dep yum-utils; \ - fi; \ -# a helper function to "yum install" things, but only if they aren't installed (and to set their "reason" to "dep" so "yum autoremove" can purge them for us) - _yum_install_temporary() { ( set -eu +x; \ - local pkg todo=''; \ - for pkg; do \ - if ! rpm --query "$pkg" > /dev/null 2>&1; then \ - todo="$todo $pkg"; \ - fi; \ - done; \ - if [ -n "$todo" ]; then \ - set -x; \ - yum install -y --setopt=skip_missing_names_on_install=False $todo; \ - yumdb set reason dep $todo; \ - fi; \ - ) }; \ - _yum_install_temporary gzip tar; \ - \ - ddist() { \ - local f="$1"; shift; \ - local distFile="$1"; shift; \ - local mvnFile="${1:-}"; \ - local success=; \ - local distUrl=; \ - for distUrl in \ -# https://apache.org/history/mirror-history.html - "https://dlcdn.apache.org/$distFile" \ -# if the version is outdated, we have to pull from the archive - "https://archive.apache.org/dist/$distFile" \ -# if all else fails, let's try Maven (https://www.mail-archive.com/users@tomcat.apache.org/msg134940.html; https://mvnrepository.com/artifact/org.apache.tomcat/tomcat; https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/) - ${mvnFile:+"https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/$mvnFile"} \ - ; do \ - if curl -fL -o "$f" "$distUrl" && [ -s "$f" ]; then \ - success=1; \ - break; \ - fi; \ - done; \ - [ -n "$success" ]; \ - }; \ - \ - ddist 'tomcat.tar.gz' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz"; \ - echo "$TOMCAT_SHA512 *tomcat.tar.gz" | sha512sum --strict --check -; \ - ddist 'tomcat.tar.gz.asc' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz.asc" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - curl -fL -o upstream-KEYS 'https://www.apache.org/dist/tomcat/tomcat-9/KEYS'; \ - gpg --batch --import upstream-KEYS; \ -# filter upstream KEYS file to *just* known/precomputed fingerprints - printf '' > filtered-KEYS; \ -# see https://www.apache.org/dist/tomcat/tomcat-9/KEYS - for key in \ - 'DCFD35E0BF8CA7344752DE8B6FB21E8933C60243' \ - 'A9C5DF4D22E99998D9875A5110C01C5A2F6059E7' \ - '48F8E69F6390C9F25CFEDCD268248959359E722B' \ - ; do \ - gpg --batch --fingerprint "$key"; \ - gpg --batch --export --armor "$key" >> filtered-KEYS; \ - done; \ - rm -rf "$GNUPGHOME"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --import filtered-KEYS; \ - gpg --batch --verify tomcat.tar.gz.asc tomcat.tar.gz; \ - tar -xf tomcat.tar.gz --strip-components=1; \ - rm bin/*.bat; \ - rm tomcat.tar.gz*; \ - rm -rf "$GNUPGHOME"; \ - \ -# https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Default_web_applications - mv webapps webapps.dist; \ - mkdir webapps; \ -# we don't delete them completely because they're frankly a pain to get back for users who do want them, and they're generally tiny (~7MB) - \ - nativeBuildDir="$(mktemp -d)"; \ - tar -xf bin/tomcat-native.tar.gz -C "$nativeBuildDir" --strip-components=1; \ - _yum_install_temporary \ - apr-devel \ - gcc \ - make \ - openssl11-devel \ - ; \ - ( \ - export CATALINA_HOME="$PWD"; \ - cd "$nativeBuildDir/native"; \ - aprConfig="$(command -v apr-1-config)"; \ - ./configure \ - --libdir="$TOMCAT_NATIVE_LIBDIR" \ - --prefix="$CATALINA_HOME" \ - --with-apr="$aprConfig" \ - --with-java-home="$JAVA_HOME" \ - --with-ssl \ - ; \ - nproc="$(nproc)"; \ - make -j "$nproc"; \ - make install; \ - ); \ - rm -rf "$nativeBuildDir"; \ - rm bin/tomcat-native.tar.gz; \ - \ -# mark any explicit dependencies as manually installed - find "$TOMCAT_NATIVE_LIBDIR" -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ && $(NF-1) != "=>" { print $(NF-1) }' \ - | xargs -rt readlink -e \ - | sort -u \ - | xargs -rt rpm --query --whatprovides \ - | sort -u \ - | tee "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt" \ - | xargs -r yumdb set reason user \ - ; \ - \ -# clean up anything added temporarily and not later marked as necessary - yum autoremove -y; \ - yum clean all; \ - rm -rf /var/cache/yum; \ - \ -# sh removes env vars it doesn't support (ones with periods) -# https://github.com/docker-library/tomcat/issues/77 - find ./bin/ -name '*.sh' -exec sed -ri 's|^#!/bin/sh$|#!/usr/bin/env bash|' '{}' +; \ - \ -# fix permissions (especially for running as non-root) -# https://github.com/docker-library/tomcat/issues/35 - chmod -R +rX .; \ - chmod 1777 logs temp work; \ - \ -# smoke test - catalina.sh version - -# verify Tomcat Native is working properly -RUN set -eux; \ - nativeLines="$(catalina.sh configtest 2>&1)"; \ - nativeLines="$(echo "$nativeLines" | grep 'Apache Tomcat Native')"; \ - nativeLines="$(echo "$nativeLines" | sort -u)"; \ - if ! echo "$nativeLines" | grep -E 'INFO: Loaded( APR based)? Apache Tomcat Native library' >&2; then \ - echo >&2 "$nativeLines"; \ - exit 1; \ - fi - -EXPOSE 8080 -CMD ["catalina.sh", "run"] diff --git a/9.0/jdk8/corretto-al2/Dockerfile b/9.0/jdk8/corretto-al2/Dockerfile deleted file mode 100644 index 9b56bfb77..000000000 --- a/9.0/jdk8/corretto-al2/Dockerfile +++ /dev/null @@ -1,163 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM amazoncorretto:8-al2-jdk - -ENV CATALINA_HOME /usr/local/tomcat -ENV PATH $CATALINA_HOME/bin:$PATH -RUN mkdir -p "$CATALINA_HOME" -WORKDIR $CATALINA_HOME - -# let "Tomcat Native" live somewhere isolated -ENV TOMCAT_NATIVE_LIBDIR $CATALINA_HOME/native-jni-lib -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOMCAT_NATIVE_LIBDIR - -ENV TOMCAT_MAJOR 9 -ENV TOMCAT_VERSION 9.0.120 -ENV TOMCAT_SHA512 07eb6d9639c3e69af81171a16ccff1c19b7fd5b2e87e3646851f0a3f42a4ce3c1bf128fbe40fc978a08935ba4f0400ef3b43ded3e470b9aaf23b97a9e1fa0858 - -RUN set -eux; \ - \ -# http://yum.baseurl.org/wiki/YumDB.html - if ! command -v yumdb > /dev/null; then \ - yum install -y --setopt=skip_missing_names_on_install=False yum-utils; \ - yumdb set reason dep yum-utils; \ - fi; \ -# a helper function to "yum install" things, but only if they aren't installed (and to set their "reason" to "dep" so "yum autoremove" can purge them for us) - _yum_install_temporary() { ( set -eu +x; \ - local pkg todo=''; \ - for pkg; do \ - if ! rpm --query "$pkg" > /dev/null 2>&1; then \ - todo="$todo $pkg"; \ - fi; \ - done; \ - if [ -n "$todo" ]; then \ - set -x; \ - yum install -y --setopt=skip_missing_names_on_install=False $todo; \ - yumdb set reason dep $todo; \ - fi; \ - ) }; \ - _yum_install_temporary gzip tar; \ - \ - ddist() { \ - local f="$1"; shift; \ - local distFile="$1"; shift; \ - local mvnFile="${1:-}"; \ - local success=; \ - local distUrl=; \ - for distUrl in \ -# https://apache.org/history/mirror-history.html - "https://dlcdn.apache.org/$distFile" \ -# if the version is outdated, we have to pull from the archive - "https://archive.apache.org/dist/$distFile" \ -# if all else fails, let's try Maven (https://www.mail-archive.com/users@tomcat.apache.org/msg134940.html; https://mvnrepository.com/artifact/org.apache.tomcat/tomcat; https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/) - ${mvnFile:+"https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/$mvnFile"} \ - ; do \ - if curl -fL -o "$f" "$distUrl" && [ -s "$f" ]; then \ - success=1; \ - break; \ - fi; \ - done; \ - [ -n "$success" ]; \ - }; \ - \ - ddist 'tomcat.tar.gz' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz"; \ - echo "$TOMCAT_SHA512 *tomcat.tar.gz" | sha512sum --strict --check -; \ - ddist 'tomcat.tar.gz.asc' "tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz.asc" "$TOMCAT_VERSION/tomcat-$TOMCAT_VERSION.tar.gz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - curl -fL -o upstream-KEYS 'https://www.apache.org/dist/tomcat/tomcat-9/KEYS'; \ - gpg --batch --import upstream-KEYS; \ -# filter upstream KEYS file to *just* known/precomputed fingerprints - printf '' > filtered-KEYS; \ -# see https://www.apache.org/dist/tomcat/tomcat-9/KEYS - for key in \ - 'DCFD35E0BF8CA7344752DE8B6FB21E8933C60243' \ - 'A9C5DF4D22E99998D9875A5110C01C5A2F6059E7' \ - '48F8E69F6390C9F25CFEDCD268248959359E722B' \ - ; do \ - gpg --batch --fingerprint "$key"; \ - gpg --batch --export --armor "$key" >> filtered-KEYS; \ - done; \ - rm -rf "$GNUPGHOME"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --import filtered-KEYS; \ - gpg --batch --verify tomcat.tar.gz.asc tomcat.tar.gz; \ - tar -xf tomcat.tar.gz --strip-components=1; \ - rm bin/*.bat; \ - rm tomcat.tar.gz*; \ - rm -rf "$GNUPGHOME"; \ - \ -# https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Default_web_applications - mv webapps webapps.dist; \ - mkdir webapps; \ -# we don't delete them completely because they're frankly a pain to get back for users who do want them, and they're generally tiny (~7MB) - \ - nativeBuildDir="$(mktemp -d)"; \ - tar -xf bin/tomcat-native.tar.gz -C "$nativeBuildDir" --strip-components=1; \ - _yum_install_temporary \ - apr-devel \ - gcc \ - make \ - openssl11-devel \ - ; \ - ( \ - export CATALINA_HOME="$PWD"; \ - cd "$nativeBuildDir/native"; \ - aprConfig="$(command -v apr-1-config)"; \ - ./configure \ - --libdir="$TOMCAT_NATIVE_LIBDIR" \ - --prefix="$CATALINA_HOME" \ - --with-apr="$aprConfig" \ - --with-java-home="$JAVA_HOME" \ - --with-ssl \ - ; \ - nproc="$(nproc)"; \ - make -j "$nproc"; \ - make install; \ - ); \ - rm -rf "$nativeBuildDir"; \ - rm bin/tomcat-native.tar.gz; \ - \ -# mark any explicit dependencies as manually installed - find "$TOMCAT_NATIVE_LIBDIR" -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ && $(NF-1) != "=>" { print $(NF-1) }' \ - | xargs -rt readlink -e \ - | sort -u \ - | xargs -rt rpm --query --whatprovides \ - | sort -u \ - | tee "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt" \ - | xargs -r yumdb set reason user \ - ; \ - \ -# clean up anything added temporarily and not later marked as necessary - yum autoremove -y; \ - yum clean all; \ - rm -rf /var/cache/yum; \ - \ -# sh removes env vars it doesn't support (ones with periods) -# https://github.com/docker-library/tomcat/issues/77 - find ./bin/ -name '*.sh' -exec sed -ri 's|^#!/bin/sh$|#!/usr/bin/env bash|' '{}' +; \ - \ -# fix permissions (especially for running as non-root) -# https://github.com/docker-library/tomcat/issues/35 - chmod -R +rX .; \ - chmod 1777 logs temp work; \ - \ -# smoke test - catalina.sh version - -# verify Tomcat Native is working properly -RUN set -eux; \ - nativeLines="$(catalina.sh configtest 2>&1)"; \ - nativeLines="$(echo "$nativeLines" | grep 'Apache Tomcat Native')"; \ - nativeLines="$(echo "$nativeLines" | sort -u)"; \ - if ! echo "$nativeLines" | grep -E 'INFO: Loaded( APR based)? Apache Tomcat Native library' >&2; then \ - echo >&2 "$nativeLines"; \ - exit 1; \ - fi - -EXPOSE 8080 -CMD ["catalina.sh", "run"] diff --git a/Dockerfile.template b/Dockerfile.template index e94d41905..61a3e9a93 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -21,7 +21,6 @@ ENV TOMCAT_SHA512 {{ .sha512 }} {{ if java_variant == "jdk" then ( -}} RUN set -eux; \ \ -{{ if is_apt then ( -}} savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends \ @@ -29,28 +28,6 @@ RUN set -eux; \ curl \ gnupg \ ; \ -{{ ) else ( -}} -# http://yum.baseurl.org/wiki/YumDB.html - if ! command -v yumdb > /dev/null; then \ - yum install -y --setopt=skip_missing_names_on_install=False yum-utils; \ - yumdb set reason dep yum-utils; \ - fi; \ -# a helper function to "yum install" things, but only if they aren't installed (and to set their "reason" to "dep" so "yum autoremove" can purge them for us) - _yum_install_temporary() { ( set -eu +x; \ - local pkg todo=''; \ - for pkg; do \ - if ! rpm --query "$pkg" > /dev/null 2>&1; then \ - todo="$todo $pkg"; \ - fi; \ - done; \ - if [ -n "$todo" ]; then \ - set -x; \ - yum install -y --setopt=skip_missing_names_on_install=False $todo; \ - yumdb set reason dep $todo; \ - fi; \ - ) }; \ - _yum_install_temporary gzip tar; \ -{{ ) end -}} \ ddist() { \ local f="$1"; shift; \ @@ -122,9 +99,7 @@ RUN set -eux; \ gpg --batch --fingerprint "$key"; \ gpg --batch --export --armor "$key" >> filtered-KEYS; \ done; \ -{{ if vendor_variant | contains("al2") then "" else ( -}} gpgconf --kill all; \ -{{ ) end -}} rm -rf "$GNUPGHOME"; \ GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ gpg --batch --import filtered-KEYS; \ @@ -132,9 +107,7 @@ RUN set -eux; \ tar -xf tomcat.tar.gz --strip-components=1; \ rm bin/*.bat; \ rm tomcat.tar.gz*; \ -{{ if vendor_variant | contains("al2") then "" else ( -}} gpgconf --kill all; \ -{{ ) end -}} rm -rf "$GNUPGHOME"; \ \ # https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Default_web_applications @@ -144,7 +117,6 @@ RUN set -eux; \ \ nativeBuildDir="$(mktemp -d)"; \ tar -xf bin/tomcat-native.tar.gz -C "$nativeBuildDir" --strip-components=1; \ -{{ if is_apt then ( -}} apt-get install -y --no-install-recommends \ dpkg-dev \ gcc \ @@ -152,25 +124,13 @@ RUN set -eux; \ libssl-dev \ make \ ; \ -{{ ) else ( -}} - _yum_install_temporary \ - apr-devel \ - gcc \ - make \ - openssl11-devel \ - ; \ -{{ ) end -}} ( \ export CATALINA_HOME="$PWD"; \ cd "$nativeBuildDir/native"; \ -{{ if is_apt then ( -}} gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ -{{ ) else "" end -}} aprConfig="$(command -v apr-1-config)"; \ ./configure \ -{{ if is_apt then ( -}} --build="$gnuArch" \ -{{ ) else "" end -}} --libdir="$TOMCAT_NATIVE_LIBDIR" \ --prefix="$CATALINA_HOME" \ --with-apr="$aprConfig" \ @@ -186,7 +146,6 @@ RUN set -eux; \ rm -rf "$nativeBuildDir"; \ rm bin/tomcat-native.tar.gz; \ \ -{{ if is_apt then ( -}} # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ @@ -203,23 +162,6 @@ RUN set -eux; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ -{{ ) else ( -}} -# mark any explicit dependencies as manually installed - find "$TOMCAT_NATIVE_LIBDIR" -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ && $(NF-1) != "=>" { print $(NF-1) }' \ - | xargs -rt readlink -e \ - | sort -u \ - | xargs -rt rpm --query --whatprovides \ - | sort -u \ - | tee "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt" \ - | xargs -r yumdb set reason user \ - ; \ - \ -# clean up anything added temporarily and not later marked as necessary - yum autoremove -y; \ - yum clean all; \ - rm -rf /var/cache/yum; \ -{{ ) end -}} \ # sh removes env vars it doesn't support (ones with periods) # https://github.com/docker-library/tomcat/issues/77 @@ -235,15 +177,9 @@ RUN set -eux; \ {{ ) else ( -}} COPY --from=tomcat:{{ .version }}-jdk{{ java_version }}-{{ vendor_variant }} $CATALINA_HOME $CATALINA_HOME RUN set -eux; \ -{{ if is_apt then ( -}} apt-get update; \ xargs -rt apt-get install -y --no-install-recommends < "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt"; \ rm -rf /var/lib/apt/lists/* -{{ ) else ( -}} - xargs -rt yum install -y --setopt=skip_missing_names_on_install=False < "$TOMCAT_NATIVE_LIBDIR/.dependencies.txt"; \ - yum clean all; \ - rm -rf /var/cache/yum -{{ ) end -}} {{ ) end -}} # verify Tomcat Native is working properly diff --git a/from.jq b/from.jq index 631ef8bd7..60cc8567d 100644 --- a/from.jq +++ b/from.jq @@ -14,9 +14,7 @@ def vendor_variant: ; def from: vendor_variant - | if test("^corretto-") then - "amazoncorretto:" + java_version + ltrimstr("corretto") + "-" + java_variant - elif test("^openjdk-") then + | if test("^openjdk-") then "openjdk:" + java_version + "-" + java_variant + ltrimstr("openjdk") elif test("^temurin-") then "eclipse-temurin:" + java_version + "-" + java_variant + ltrimstr("temurin") diff --git a/shared.jq b/shared.jq index b407b207e..a97c85d19 100644 --- a/shared.jq +++ b/shared.jq @@ -16,21 +16,9 @@ def is_supported_java_version(java): java >= 8 end ; -def is_apt: - vendor_variant | ( - contains("al2") - ) | not -; def is_native_ge_2: # https://github.com/apache/tomcat-native/commit/f7930fa16f095717cfc641a8d24e60c343765adc # https://github.com/docker-library/tomcat/pull/272 (env.version | tonumber) as $version | $version >= 10.1 ; -def has_openssl_ge_3(variant): - # https://github.com/apache/tomcat-native/commit/f7930fa16f095717cfc641a8d24e60c343765adc - variant | ( - # amazonlinux - contains("al2") # corretto - ) | not -; diff --git a/versions.json b/versions.json index bcc31f60c..7d8b363ea 100644 --- a/versions.json +++ b/versions.json @@ -50,22 +50,18 @@ "jre21/temurin-noble", "jdk21/temurin-jammy", "jre21/temurin-jammy", - "jdk21/corretto-al2", "jdk17/temurin-noble", "jre17/temurin-noble", "jdk17/temurin-jammy", "jre17/temurin-jammy", - "jdk17/corretto-al2", "jdk11/temurin-noble", "jre11/temurin-noble", "jdk11/temurin-jammy", "jre11/temurin-jammy", - "jdk11/corretto-al2", "jdk8/temurin-noble", "jre8/temurin-noble", "jdk8/temurin-jammy", - "jre8/temurin-jammy", - "jdk8/corretto-al2" + "jre8/temurin-jammy" ], "version": "9.0.120" } diff --git a/versions.sh b/versions.sh index 5cf3c8739..6f902be4d 100755 --- a/versions.sh +++ b/versions.sh @@ -31,7 +31,6 @@ for javaVersion in 25 21 17 11 8; do for vendorVariant in \ temurin-{noble,jammy} \ openjdk{,-slim}-{trixie,bookworm} \ - corretto-al2 \ ; do for javaVariant in {jdk,jre}"$javaVersion"; do export variant="$javaVariant/$vendorVariant" @@ -97,10 +96,6 @@ for version in "${versions[@]}"; do | tonumber ) as $java_version | is_supported_java_version($java_version) - and ( - (is_native_ge_2 | not) - or has_openssl_ge_3(.) - ) )) ), }