From 0d6216680eb612c3672965c0029d67dde6b3039c Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 10 Nov 2023 11:17:36 +1100 Subject: [PATCH 1/3] Add Java 21 image variants Signed-off-by: Lachlan Roberts --- amazoncorretto/10.0/jdk21-alpine/Dockerfile | 83 ++++++++++++++ .../10.0/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jdk21-alpine/generate-jetty-start.sh | 19 +++ amazoncorretto/10.0/jdk21/Dockerfile | 85 ++++++++++++++ .../10.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jdk21/generate-jetty-start.sh | 19 +++ amazoncorretto/11.0/jdk21-alpine/Dockerfile | 83 ++++++++++++++ .../11.0/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jdk21-alpine/generate-jetty-start.sh | 19 +++ amazoncorretto/11.0/jdk21/Dockerfile | 85 ++++++++++++++ .../11.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jdk21/generate-jetty-start.sh | 19 +++ amazoncorretto/12.0/jdk21-alpine/Dockerfile | 83 ++++++++++++++ .../12.0/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jdk21-alpine/generate-jetty-start.sh | 19 +++ amazoncorretto/12.0/jdk21/Dockerfile | 85 ++++++++++++++ .../12.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jdk21/generate-jetty-start.sh | 19 +++ amazoncorretto/9.4/jdk21-alpine/Dockerfile | 83 ++++++++++++++ .../9.4/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jdk21-alpine/generate-jetty-start.sh | 19 +++ amazoncorretto/9.4/jdk21/Dockerfile | 85 ++++++++++++++ amazoncorretto/9.4/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jdk21/generate-jetty-start.sh | 19 +++ .../zulu-openjdk-alpine/10.0/jdk21/Dockerfile | 83 ++++++++++++++ .../10.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jdk21/generate-jetty-start.sh | 19 +++ .../zulu-openjdk-alpine/11.0/jdk21/Dockerfile | 83 ++++++++++++++ .../11.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jdk21/generate-jetty-start.sh | 19 +++ .../zulu-openjdk-alpine/12.0/jdk21/Dockerfile | 83 ++++++++++++++ .../12.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jdk21/generate-jetty-start.sh | 19 +++ azul/zulu-openjdk-alpine/9.4/jdk21/Dockerfile | 83 ++++++++++++++ .../9.4/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jdk21/generate-jetty-start.sh | 19 +++ azul/zulu-openjdk/10.0/jdk21/Dockerfile | 99 ++++++++++++++++ .../10.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jdk21/generate-jetty-start.sh | 19 +++ azul/zulu-openjdk/11.0/jdk21/Dockerfile | 99 ++++++++++++++++ .../11.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jdk21/generate-jetty-start.sh | 19 +++ azul/zulu-openjdk/12.0/jdk21/Dockerfile | 99 ++++++++++++++++ .../12.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jdk21/generate-jetty-start.sh | 19 +++ azul/zulu-openjdk/9.4/jdk21/Dockerfile | 99 ++++++++++++++++ .../9.4/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jdk21/generate-jetty-start.sh | 19 +++ eclipse-temurin/10.0/jdk21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/10.0/jdk21-alpine/arches | 1 + .../10.0/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jdk21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/10.0/jdk21/Dockerfile | 99 ++++++++++++++++ .../10.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jdk21/generate-jetty-start.sh | 19 +++ eclipse-temurin/10.0/jre21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/10.0/jre21-alpine/arches | 1 + .../10.0/jre21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jre21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/10.0/jre21/Dockerfile | 99 ++++++++++++++++ .../10.0/jre21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../10.0/jre21/generate-jetty-start.sh | 19 +++ eclipse-temurin/11.0/jdk21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/11.0/jdk21-alpine/arches | 1 + .../11.0/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jdk21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/11.0/jdk21/Dockerfile | 99 ++++++++++++++++ .../11.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jdk21/generate-jetty-start.sh | 19 +++ eclipse-temurin/11.0/jre21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/11.0/jre21-alpine/arches | 1 + .../11.0/jre21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jre21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/11.0/jre21/Dockerfile | 99 ++++++++++++++++ .../11.0/jre21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../11.0/jre21/generate-jetty-start.sh | 19 +++ eclipse-temurin/12.0/jdk21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/12.0/jdk21-alpine/arches | 1 + .../12.0/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jdk21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/12.0/jdk21/Dockerfile | 99 ++++++++++++++++ .../12.0/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jdk21/generate-jetty-start.sh | 19 +++ eclipse-temurin/12.0/jre21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/12.0/jre21-alpine/arches | 1 + .../12.0/jre21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jre21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/12.0/jre21/Dockerfile | 99 ++++++++++++++++ .../12.0/jre21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../12.0/jre21/generate-jetty-start.sh | 19 +++ eclipse-temurin/9.4/jdk21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/9.4/jdk21-alpine/arches | 1 + .../9.4/jdk21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jdk21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/9.4/jdk21/Dockerfile | 99 ++++++++++++++++ .../9.4/jdk21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jdk21/generate-jetty-start.sh | 19 +++ eclipse-temurin/9.4/jre21-alpine/Dockerfile | 83 ++++++++++++++ eclipse-temurin/9.4/jre21-alpine/arches | 1 + .../9.4/jre21-alpine/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jre21-alpine/generate-jetty-start.sh | 19 +++ eclipse-temurin/9.4/jre21/Dockerfile | 99 ++++++++++++++++ .../9.4/jre21/docker-entrypoint.sh | 108 ++++++++++++++++++ .../9.4/jre21/generate-jetty-start.sh | 19 +++ 104 files changed, 6928 insertions(+) create mode 100644 amazoncorretto/10.0/jdk21-alpine/Dockerfile create mode 100755 amazoncorretto/10.0/jdk21-alpine/docker-entrypoint.sh create mode 100755 amazoncorretto/10.0/jdk21-alpine/generate-jetty-start.sh create mode 100644 amazoncorretto/10.0/jdk21/Dockerfile create mode 100755 amazoncorretto/10.0/jdk21/docker-entrypoint.sh create mode 100755 amazoncorretto/10.0/jdk21/generate-jetty-start.sh create mode 100644 amazoncorretto/11.0/jdk21-alpine/Dockerfile create mode 100755 amazoncorretto/11.0/jdk21-alpine/docker-entrypoint.sh create mode 100755 amazoncorretto/11.0/jdk21-alpine/generate-jetty-start.sh create mode 100644 amazoncorretto/11.0/jdk21/Dockerfile create mode 100755 amazoncorretto/11.0/jdk21/docker-entrypoint.sh create mode 100755 amazoncorretto/11.0/jdk21/generate-jetty-start.sh create mode 100644 amazoncorretto/12.0/jdk21-alpine/Dockerfile create mode 100755 amazoncorretto/12.0/jdk21-alpine/docker-entrypoint.sh create mode 100755 amazoncorretto/12.0/jdk21-alpine/generate-jetty-start.sh create mode 100644 amazoncorretto/12.0/jdk21/Dockerfile create mode 100755 amazoncorretto/12.0/jdk21/docker-entrypoint.sh create mode 100755 amazoncorretto/12.0/jdk21/generate-jetty-start.sh create mode 100644 amazoncorretto/9.4/jdk21-alpine/Dockerfile create mode 100755 amazoncorretto/9.4/jdk21-alpine/docker-entrypoint.sh create mode 100755 amazoncorretto/9.4/jdk21-alpine/generate-jetty-start.sh create mode 100644 amazoncorretto/9.4/jdk21/Dockerfile create mode 100755 amazoncorretto/9.4/jdk21/docker-entrypoint.sh create mode 100755 amazoncorretto/9.4/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk-alpine/10.0/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk-alpine/10.0/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk-alpine/10.0/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk-alpine/11.0/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk-alpine/11.0/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk-alpine/11.0/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk-alpine/12.0/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk-alpine/12.0/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk-alpine/12.0/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk-alpine/9.4/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk-alpine/9.4/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk-alpine/9.4/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk/10.0/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk/10.0/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk/10.0/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk/11.0/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk/11.0/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk/11.0/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk/12.0/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk/12.0/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk/12.0/jdk21/generate-jetty-start.sh create mode 100644 azul/zulu-openjdk/9.4/jdk21/Dockerfile create mode 100755 azul/zulu-openjdk/9.4/jdk21/docker-entrypoint.sh create mode 100755 azul/zulu-openjdk/9.4/jdk21/generate-jetty-start.sh create mode 100644 eclipse-temurin/10.0/jdk21-alpine/Dockerfile create mode 100644 eclipse-temurin/10.0/jdk21-alpine/arches create mode 100755 eclipse-temurin/10.0/jdk21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/10.0/jdk21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/10.0/jdk21/Dockerfile create mode 100755 eclipse-temurin/10.0/jdk21/docker-entrypoint.sh create mode 100755 eclipse-temurin/10.0/jdk21/generate-jetty-start.sh create mode 100644 eclipse-temurin/10.0/jre21-alpine/Dockerfile create mode 100644 eclipse-temurin/10.0/jre21-alpine/arches create mode 100755 eclipse-temurin/10.0/jre21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/10.0/jre21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/10.0/jre21/Dockerfile create mode 100755 eclipse-temurin/10.0/jre21/docker-entrypoint.sh create mode 100755 eclipse-temurin/10.0/jre21/generate-jetty-start.sh create mode 100644 eclipse-temurin/11.0/jdk21-alpine/Dockerfile create mode 100644 eclipse-temurin/11.0/jdk21-alpine/arches create mode 100755 eclipse-temurin/11.0/jdk21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/11.0/jdk21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/11.0/jdk21/Dockerfile create mode 100755 eclipse-temurin/11.0/jdk21/docker-entrypoint.sh create mode 100755 eclipse-temurin/11.0/jdk21/generate-jetty-start.sh create mode 100644 eclipse-temurin/11.0/jre21-alpine/Dockerfile create mode 100644 eclipse-temurin/11.0/jre21-alpine/arches create mode 100755 eclipse-temurin/11.0/jre21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/11.0/jre21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/11.0/jre21/Dockerfile create mode 100755 eclipse-temurin/11.0/jre21/docker-entrypoint.sh create mode 100755 eclipse-temurin/11.0/jre21/generate-jetty-start.sh create mode 100644 eclipse-temurin/12.0/jdk21-alpine/Dockerfile create mode 100644 eclipse-temurin/12.0/jdk21-alpine/arches create mode 100755 eclipse-temurin/12.0/jdk21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/12.0/jdk21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/12.0/jdk21/Dockerfile create mode 100755 eclipse-temurin/12.0/jdk21/docker-entrypoint.sh create mode 100755 eclipse-temurin/12.0/jdk21/generate-jetty-start.sh create mode 100644 eclipse-temurin/12.0/jre21-alpine/Dockerfile create mode 100644 eclipse-temurin/12.0/jre21-alpine/arches create mode 100755 eclipse-temurin/12.0/jre21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/12.0/jre21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/12.0/jre21/Dockerfile create mode 100755 eclipse-temurin/12.0/jre21/docker-entrypoint.sh create mode 100755 eclipse-temurin/12.0/jre21/generate-jetty-start.sh create mode 100644 eclipse-temurin/9.4/jdk21-alpine/Dockerfile create mode 100644 eclipse-temurin/9.4/jdk21-alpine/arches create mode 100755 eclipse-temurin/9.4/jdk21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/9.4/jdk21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/9.4/jdk21/Dockerfile create mode 100755 eclipse-temurin/9.4/jdk21/docker-entrypoint.sh create mode 100755 eclipse-temurin/9.4/jdk21/generate-jetty-start.sh create mode 100644 eclipse-temurin/9.4/jre21-alpine/Dockerfile create mode 100644 eclipse-temurin/9.4/jre21-alpine/arches create mode 100755 eclipse-temurin/9.4/jre21-alpine/docker-entrypoint.sh create mode 100755 eclipse-temurin/9.4/jre21-alpine/generate-jetty-start.sh create mode 100644 eclipse-temurin/9.4/jre21/Dockerfile create mode 100755 eclipse-temurin/9.4/jre21/docker-entrypoint.sh create mode 100755 eclipse-temurin/9.4/jre21/generate-jetty-start.sh diff --git a/amazoncorretto/10.0/jdk21-alpine/Dockerfile b/amazoncorretto/10.0/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..dab13efa --- /dev/null +++ b/amazoncorretto/10.0/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM amazoncorretto:21-alpine + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/10.0/jdk21-alpine/docker-entrypoint.sh b/amazoncorretto/10.0/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/10.0/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/10.0/jdk21-alpine/generate-jetty-start.sh b/amazoncorretto/10.0/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/10.0/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/10.0/jdk21/Dockerfile b/amazoncorretto/10.0/jdk21/Dockerfile new file mode 100644 index 00000000..a6277836 --- /dev/null +++ b/amazoncorretto/10.0/jdk21/Dockerfile @@ -0,0 +1,85 @@ +# DO NOT EDIT. Edit baseDockerfile-amazoncorretto and use update.sh +FROM amazoncorretto:21 + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utilities needed for setup. + yum install -y shadow-utils tar xz gzip && yum clean all ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/10.0/jdk21/docker-entrypoint.sh b/amazoncorretto/10.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/10.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/10.0/jdk21/generate-jetty-start.sh b/amazoncorretto/10.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/10.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/11.0/jdk21-alpine/Dockerfile b/amazoncorretto/11.0/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..8f4ea9de --- /dev/null +++ b/amazoncorretto/11.0/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM amazoncorretto:21-alpine + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/11.0/jdk21-alpine/docker-entrypoint.sh b/amazoncorretto/11.0/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/11.0/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/11.0/jdk21-alpine/generate-jetty-start.sh b/amazoncorretto/11.0/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/11.0/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/11.0/jdk21/Dockerfile b/amazoncorretto/11.0/jdk21/Dockerfile new file mode 100644 index 00000000..c3f0378d --- /dev/null +++ b/amazoncorretto/11.0/jdk21/Dockerfile @@ -0,0 +1,85 @@ +# DO NOT EDIT. Edit baseDockerfile-amazoncorretto and use update.sh +FROM amazoncorretto:21 + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utilities needed for setup. + yum install -y shadow-utils tar xz gzip && yum clean all ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/11.0/jdk21/docker-entrypoint.sh b/amazoncorretto/11.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/11.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/11.0/jdk21/generate-jetty-start.sh b/amazoncorretto/11.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/11.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/12.0/jdk21-alpine/Dockerfile b/amazoncorretto/12.0/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..178e1878 --- /dev/null +++ b/amazoncorretto/12.0/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM amazoncorretto:21-alpine + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/12.0/jdk21-alpine/docker-entrypoint.sh b/amazoncorretto/12.0/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/12.0/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/12.0/jdk21-alpine/generate-jetty-start.sh b/amazoncorretto/12.0/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/12.0/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/12.0/jdk21/Dockerfile b/amazoncorretto/12.0/jdk21/Dockerfile new file mode 100644 index 00000000..5108e5e0 --- /dev/null +++ b/amazoncorretto/12.0/jdk21/Dockerfile @@ -0,0 +1,85 @@ +# DO NOT EDIT. Edit baseDockerfile-amazoncorretto and use update.sh +FROM amazoncorretto:21 + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utilities needed for setup. + yum install -y shadow-utils tar xz gzip && yum clean all ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/12.0/jdk21/docker-entrypoint.sh b/amazoncorretto/12.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/12.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/12.0/jdk21/generate-jetty-start.sh b/amazoncorretto/12.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/12.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/9.4/jdk21-alpine/Dockerfile b/amazoncorretto/9.4/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..3d0efc25 --- /dev/null +++ b/amazoncorretto/9.4/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM amazoncorretto:21-alpine + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/9.4/jdk21-alpine/docker-entrypoint.sh b/amazoncorretto/9.4/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/9.4/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/9.4/jdk21-alpine/generate-jetty-start.sh b/amazoncorretto/9.4/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/9.4/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/amazoncorretto/9.4/jdk21/Dockerfile b/amazoncorretto/9.4/jdk21/Dockerfile new file mode 100644 index 00000000..9a4617df --- /dev/null +++ b/amazoncorretto/9.4/jdk21/Dockerfile @@ -0,0 +1,85 @@ +# DO NOT EDIT. Edit baseDockerfile-amazoncorretto and use update.sh +FROM amazoncorretto:21 + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utilities needed for setup. + yum install -y shadow-utils tar xz gzip && yum clean all ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/amazoncorretto/9.4/jdk21/docker-entrypoint.sh b/amazoncorretto/9.4/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/amazoncorretto/9.4/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/amazoncorretto/9.4/jdk21/generate-jetty-start.sh b/amazoncorretto/9.4/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/amazoncorretto/9.4/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk-alpine/10.0/jdk21/Dockerfile b/azul/zulu-openjdk-alpine/10.0/jdk21/Dockerfile new file mode 100644 index 00000000..bcc066ae --- /dev/null +++ b/azul/zulu-openjdk-alpine/10.0/jdk21/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM azul/zulu-openjdk-alpine:21 + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk-alpine/10.0/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk-alpine/10.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk-alpine/10.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk-alpine/10.0/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk-alpine/10.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk-alpine/10.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk-alpine/11.0/jdk21/Dockerfile b/azul/zulu-openjdk-alpine/11.0/jdk21/Dockerfile new file mode 100644 index 00000000..39d5ca7d --- /dev/null +++ b/azul/zulu-openjdk-alpine/11.0/jdk21/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM azul/zulu-openjdk-alpine:21 + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk-alpine/11.0/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk-alpine/11.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk-alpine/11.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk-alpine/11.0/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk-alpine/11.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk-alpine/11.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk-alpine/12.0/jdk21/Dockerfile b/azul/zulu-openjdk-alpine/12.0/jdk21/Dockerfile new file mode 100644 index 00000000..ad57802b --- /dev/null +++ b/azul/zulu-openjdk-alpine/12.0/jdk21/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM azul/zulu-openjdk-alpine:21 + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk-alpine/12.0/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk-alpine/12.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk-alpine/12.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk-alpine/12.0/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk-alpine/12.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk-alpine/12.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk-alpine/9.4/jdk21/Dockerfile b/azul/zulu-openjdk-alpine/9.4/jdk21/Dockerfile new file mode 100644 index 00000000..2b6e35c8 --- /dev/null +++ b/azul/zulu-openjdk-alpine/9.4/jdk21/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM azul/zulu-openjdk-alpine:21 + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk-alpine/9.4/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk-alpine/9.4/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk-alpine/9.4/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk-alpine/9.4/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk-alpine/9.4/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk-alpine/9.4/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk/10.0/jdk21/Dockerfile b/azul/zulu-openjdk/10.0/jdk21/Dockerfile new file mode 100644 index 00000000..21abf416 --- /dev/null +++ b/azul/zulu-openjdk/10.0/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM azul/zulu-openjdk:21 + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk/10.0/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk/10.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk/10.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk/10.0/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk/10.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk/10.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk/11.0/jdk21/Dockerfile b/azul/zulu-openjdk/11.0/jdk21/Dockerfile new file mode 100644 index 00000000..097a529b --- /dev/null +++ b/azul/zulu-openjdk/11.0/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM azul/zulu-openjdk:21 + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk/11.0/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk/11.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk/11.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk/11.0/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk/11.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk/11.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk/12.0/jdk21/Dockerfile b/azul/zulu-openjdk/12.0/jdk21/Dockerfile new file mode 100644 index 00000000..63016cd2 --- /dev/null +++ b/azul/zulu-openjdk/12.0/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM azul/zulu-openjdk:21 + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk/12.0/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk/12.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk/12.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk/12.0/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk/12.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk/12.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/azul/zulu-openjdk/9.4/jdk21/Dockerfile b/azul/zulu-openjdk/9.4/jdk21/Dockerfile new file mode 100644 index 00000000..95c47f5b --- /dev/null +++ b/azul/zulu-openjdk/9.4/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM azul/zulu-openjdk:21 + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/azul/zulu-openjdk/9.4/jdk21/docker-entrypoint.sh b/azul/zulu-openjdk/9.4/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/azul/zulu-openjdk/9.4/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/azul/zulu-openjdk/9.4/jdk21/generate-jetty-start.sh b/azul/zulu-openjdk/9.4/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/azul/zulu-openjdk/9.4/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/10.0/jdk21-alpine/Dockerfile b/eclipse-temurin/10.0/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..b6f3dc36 --- /dev/null +++ b/eclipse-temurin/10.0/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jdk-alpine + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/10.0/jdk21-alpine/arches b/eclipse-temurin/10.0/jdk21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/10.0/jdk21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/10.0/jdk21-alpine/docker-entrypoint.sh b/eclipse-temurin/10.0/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/10.0/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/10.0/jdk21-alpine/generate-jetty-start.sh b/eclipse-temurin/10.0/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/10.0/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/10.0/jdk21/Dockerfile b/eclipse-temurin/10.0/jdk21/Dockerfile new file mode 100644 index 00000000..dbd0c709 --- /dev/null +++ b/eclipse-temurin/10.0/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jdk-focal + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/10.0/jdk21/docker-entrypoint.sh b/eclipse-temurin/10.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/10.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/10.0/jdk21/generate-jetty-start.sh b/eclipse-temurin/10.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/10.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/10.0/jre21-alpine/Dockerfile b/eclipse-temurin/10.0/jre21-alpine/Dockerfile new file mode 100644 index 00000000..4585ef59 --- /dev/null +++ b/eclipse-temurin/10.0/jre21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jre-alpine + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/10.0/jre21-alpine/arches b/eclipse-temurin/10.0/jre21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/10.0/jre21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/10.0/jre21-alpine/docker-entrypoint.sh b/eclipse-temurin/10.0/jre21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/10.0/jre21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/10.0/jre21-alpine/generate-jetty-start.sh b/eclipse-temurin/10.0/jre21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/10.0/jre21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/10.0/jre21/Dockerfile b/eclipse-temurin/10.0/jre21/Dockerfile new file mode 100644 index 00000000..e9b95e56 --- /dev/null +++ b/eclipse-temurin/10.0/jre21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jre + +ENV JETTY_VERSION 10.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/10.0/jre21/docker-entrypoint.sh b/eclipse-temurin/10.0/jre21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/10.0/jre21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/10.0/jre21/generate-jetty-start.sh b/eclipse-temurin/10.0/jre21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/10.0/jre21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/11.0/jdk21-alpine/Dockerfile b/eclipse-temurin/11.0/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..27f12439 --- /dev/null +++ b/eclipse-temurin/11.0/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jdk-alpine + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/11.0/jdk21-alpine/arches b/eclipse-temurin/11.0/jdk21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/11.0/jdk21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/11.0/jdk21-alpine/docker-entrypoint.sh b/eclipse-temurin/11.0/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/11.0/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/11.0/jdk21-alpine/generate-jetty-start.sh b/eclipse-temurin/11.0/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/11.0/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/11.0/jdk21/Dockerfile b/eclipse-temurin/11.0/jdk21/Dockerfile new file mode 100644 index 00000000..5099eb19 --- /dev/null +++ b/eclipse-temurin/11.0/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jdk-focal + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/11.0/jdk21/docker-entrypoint.sh b/eclipse-temurin/11.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/11.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/11.0/jdk21/generate-jetty-start.sh b/eclipse-temurin/11.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/11.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/11.0/jre21-alpine/Dockerfile b/eclipse-temurin/11.0/jre21-alpine/Dockerfile new file mode 100644 index 00000000..939e9991 --- /dev/null +++ b/eclipse-temurin/11.0/jre21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jre-alpine + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/11.0/jre21-alpine/arches b/eclipse-temurin/11.0/jre21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/11.0/jre21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/11.0/jre21-alpine/docker-entrypoint.sh b/eclipse-temurin/11.0/jre21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/11.0/jre21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/11.0/jre21-alpine/generate-jetty-start.sh b/eclipse-temurin/11.0/jre21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/11.0/jre21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/11.0/jre21/Dockerfile b/eclipse-temurin/11.0/jre21/Dockerfile new file mode 100644 index 00000000..38b682fb --- /dev/null +++ b/eclipse-temurin/11.0/jre21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jre + +ENV JETTY_VERSION 11.0.18 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/11.0/jre21/docker-entrypoint.sh b/eclipse-temurin/11.0/jre21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/11.0/jre21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/11.0/jre21/generate-jetty-start.sh b/eclipse-temurin/11.0/jre21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/11.0/jre21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/12.0/jdk21-alpine/Dockerfile b/eclipse-temurin/12.0/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..73df1a0c --- /dev/null +++ b/eclipse-temurin/12.0/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jdk-alpine + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/12.0/jdk21-alpine/arches b/eclipse-temurin/12.0/jdk21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/12.0/jdk21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/12.0/jdk21-alpine/docker-entrypoint.sh b/eclipse-temurin/12.0/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/12.0/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/12.0/jdk21-alpine/generate-jetty-start.sh b/eclipse-temurin/12.0/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/12.0/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/12.0/jdk21/Dockerfile b/eclipse-temurin/12.0/jdk21/Dockerfile new file mode 100644 index 00000000..60c47d4e --- /dev/null +++ b/eclipse-temurin/12.0/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jdk-focal + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/12.0/jdk21/docker-entrypoint.sh b/eclipse-temurin/12.0/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/12.0/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/12.0/jdk21/generate-jetty-start.sh b/eclipse-temurin/12.0/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/12.0/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/12.0/jre21-alpine/Dockerfile b/eclipse-temurin/12.0/jre21-alpine/Dockerfile new file mode 100644 index 00000000..0f69ab64 --- /dev/null +++ b/eclipse-temurin/12.0/jre21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jre-alpine + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/12.0/jre21-alpine/arches b/eclipse-temurin/12.0/jre21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/12.0/jre21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/12.0/jre21-alpine/docker-entrypoint.sh b/eclipse-temurin/12.0/jre21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/12.0/jre21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/12.0/jre21-alpine/generate-jetty-start.sh b/eclipse-temurin/12.0/jre21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/12.0/jre21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/12.0/jre21/Dockerfile b/eclipse-temurin/12.0/jre21/Dockerfile new file mode 100644 index 00000000..8e1e51b8 --- /dev/null +++ b/eclipse-temurin/12.0/jre21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jre + +ENV JETTY_VERSION 12.0.3 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/12.0/jre21/docker-entrypoint.sh b/eclipse-temurin/12.0/jre21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/12.0/jre21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/12.0/jre21/generate-jetty-start.sh b/eclipse-temurin/12.0/jre21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/12.0/jre21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/9.4/jdk21-alpine/Dockerfile b/eclipse-temurin/9.4/jdk21-alpine/Dockerfile new file mode 100644 index 00000000..a4e9b8ec --- /dev/null +++ b/eclipse-temurin/9.4/jdk21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jdk-alpine + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/9.4/jdk21-alpine/arches b/eclipse-temurin/9.4/jdk21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/9.4/jdk21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/9.4/jdk21-alpine/docker-entrypoint.sh b/eclipse-temurin/9.4/jdk21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/9.4/jdk21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/9.4/jdk21-alpine/generate-jetty-start.sh b/eclipse-temurin/9.4/jdk21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/9.4/jdk21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/9.4/jdk21/Dockerfile b/eclipse-temurin/9.4/jdk21/Dockerfile new file mode 100644 index 00000000..063c8b18 --- /dev/null +++ b/eclipse-temurin/9.4/jdk21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jdk-focal + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/9.4/jdk21/docker-entrypoint.sh b/eclipse-temurin/9.4/jdk21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/9.4/jdk21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/9.4/jdk21/generate-jetty-start.sh b/eclipse-temurin/9.4/jdk21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/9.4/jdk21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/9.4/jre21-alpine/Dockerfile b/eclipse-temurin/9.4/jre21-alpine/Dockerfile new file mode 100644 index 00000000..ffb3060a --- /dev/null +++ b/eclipse-temurin/9.4/jre21-alpine/Dockerfile @@ -0,0 +1,83 @@ +# DO NOT EDIT. Edit baseDockerfile-alpine and use update.sh +FROM eclipse-temurin:21-jre-alpine + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apk add --no-cache gnupg curl ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + addgroup -S jetty && adduser -h $JETTY_BASE -S jetty -G jetty; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/9.4/jre21-alpine/arches b/eclipse-temurin/9.4/jre21-alpine/arches new file mode 100644 index 00000000..33a92686 --- /dev/null +++ b/eclipse-temurin/9.4/jre21-alpine/arches @@ -0,0 +1 @@ +amd64 \ No newline at end of file diff --git a/eclipse-temurin/9.4/jre21-alpine/docker-entrypoint.sh b/eclipse-temurin/9.4/jre21-alpine/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/9.4/jre21-alpine/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/9.4/jre21-alpine/generate-jetty-start.sh b/eclipse-temurin/9.4/jre21-alpine/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/9.4/jre21-alpine/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi diff --git a/eclipse-temurin/9.4/jre21/Dockerfile b/eclipse-temurin/9.4/jre21/Dockerfile new file mode 100644 index 00000000..3f96f41c --- /dev/null +++ b/eclipse-temurin/9.4/jre21/Dockerfile @@ -0,0 +1,99 @@ +# DO NOT EDIT. Edit baseDockerfile-slim and use update.sh +FROM eclipse-temurin:21-jre + +ENV JETTY_VERSION 9.4.53.v20231009 +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH $JETTY_HOME/bin:$PATH +ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$JETTY_VERSION/jetty-home-$JETTY_VERSION.tar.gz + +# GPG Keys are personal keys of Jetty committers (see https://github.com/eclipse/jetty.project/blob/0607c0e66e44b9c12a62b85551da3a0edce0281e/KEYS.txt) +ENV JETTY_GPG_KEYS \ + # Jan Bartel + AED5EE6C45D0FE8D5D1B164F27DED4BF6216DB8F \ + # Jesse McConnell + 2A684B57436A81FA8706B53C61C3351A438A3B7D \ + # Joakim Erdfelt + 5989BAF76217B843D66BE55B2D0E1FB8FE4B68B4 \ + # Joakim Erdfelt + B59B67FD7904984367F931800818D9D68FB67BAC \ + # Joakim Erdfelt + BFBB21C246D7776836287A48A04E0C74ABB35FEA \ + # Simone Bordet + 8B096546B1A8F02656B15D3B1677D141BCF3584D \ + # Olivier Lamy + F254B35617DC255D9344BCFA873A8E86B4372146 \ + # Ludovic Orban + E22488CC94F63E3FC928536C4241C08270D999C3 + +RUN set -xe ; \ + # Save initial installation state + export savedAptMark="$(apt-mark showmanual)" ; \ + # + mkdir -p $TMPDIR ; \ + # + # Install utils needed to verify keys + apt-get update ; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + p11-kit \ + gnupg \ + curl \ + ; \ + # + # fetch GPG keys + export GNUPGHOME=/jetty-keys ; \ + mkdir -p "$GNUPGHOME" ; \ + for key in $JETTY_GPG_KEYS; do \ + gpg --batch --keyserver "hkps://keyserver.ubuntu.com" --recv-keys "$key"; \ + done ; \ + # + # Fetch jetty release into JETTY_HOME + mkdir -p "$JETTY_HOME" ; \ + cd $JETTY_HOME ; \ + curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz ; \ + curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc ; \ + # + # Verify GPG signatures + gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz ; \ + # + # Unpack jetty + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + # + # Create and configure the JETTY_HOME directory + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + case "$JETTY_VERSION" in \ + "12."*) START_MODULES="server,http,ext,resources" ;; \ + *) START_MODULES="server,http,deploy,ext,resources,jsp,jstl,websocket" ;; \ + esac ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd \ + --add-to-start="$START_MODULES" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + # + # Cleanup any apt + apt-mark auto '.*' > /dev/null ; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ + rm -rf /var/lib/apt/lists/* ; \ + # + # Cleanup + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + rm -fr /jetty-keys $GNUPGHOME ; \ + rm -rf /tmp/hsperfdata_root ; \ + # + # Basic smoke test + java -jar "$JETTY_HOME/start.jar" --list-config ; + +WORKDIR $JETTY_BASE +COPY docker-entrypoint.sh generate-jetty-start.sh / + +USER jetty +EXPOSE 8080 +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["java","-jar","/usr/local/jetty/start.jar"] diff --git a/eclipse-temurin/9.4/jre21/docker-entrypoint.sh b/eclipse-temurin/9.4/jre21/docker-entrypoint.sh new file mode 100755 index 00000000..573a9282 --- /dev/null +++ b/eclipse-temurin/9.4/jre21/docker-entrypoint.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +set -e + +if [ "$1" = jetty.sh ]; then + if ! command -v bash >/dev/null 2>&1 ; then + cat >&2 <<- 'EOWARN' + ******************************************************************** + ERROR: bash not found. Use of jetty.sh requires bash. + ******************************************************************** + EOWARN + exit 1 + fi + cat >&2 <<- 'EOWARN' + ******************************************************************** + WARNING: Use of jetty.sh from this image is deprecated and may + be removed at some point in the future. + + See the documentation for guidance on extending this image: + https://github.com/docker-library/docs/tree/master/jetty + ******************************************************************** + EOWARN +fi + +if ! command -v -- "$1" >/dev/null 2>&1 ; then + set -- java -jar "$JETTY_HOME/start.jar" "$@" +fi + +: ${TMPDIR:=/tmp/jetty} +[ -d "$TMPDIR" ] || mkdir -p $TMPDIR 2>/dev/null + +: ${JETTY_START:=$JETTY_BASE/jetty.start} + +case "$JAVA_OPTIONS" in + *-Djava.io.tmpdir=*) ;; + *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; +esac + +if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then + # this is a command to run jetty + + # check if it is a terminating command + for A in "$@" ; do + case $A in + --add-to-start* |\ + --create-files |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --stop |\ + --update-ini |\ + --version |\ + -v )\ + # It is a terminating command, so exec directly + JAVA="$1" + shift + # The $START_OPTIONS is the JVM options for the JVM which will do the --dry-run. + # The $JAVA_OPTIONS contains the JVM options used in the output of the --dry-run command. + eval "exec $JAVA $START_OPTIONS \"\$@\" $JAVA_OPTIONS $JETTY_PROPERTIES" + esac + done + + if [ $(whoami) != "jetty" ]; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: User is $(whoami) + The user should be (re)set to 'jetty' in the Dockerfile + ******************************************************************** + EOWARN + fi + + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then + cat >&2 <<- EOWARN + ******************************************************************** + WARNING: The $JETTY_BASE/start.d directory has been modified since + the $JETTY_START files was generated. + To avoid regeneration delays at start, either delete + the $JETTY_START file or re-run /generate-jetty-start.sh + from a Dockerfile. + ******************************************************************** + EOWARN + /generate-jetty-start.sh "$@" + fi + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + else + /generate-jetty-start.sh "$@" + fi + + ## The generate-jetty-start script always starts the jetty.start file with exec, so this command will exec Jetty. + ## We need to do this because the file may have quoted arguments which cannot be read into a variable. + . $JETTY_START +fi + +if [ "${1##*/}" = java -a -n "$JAVA_OPTIONS" ] ; then + JAVA="$1" + shift + set -- "$JAVA" $JAVA_OPTIONS "$@" +fi + +exec "$@" diff --git a/eclipse-temurin/9.4/jre21/generate-jetty-start.sh b/eclipse-temurin/9.4/jre21/generate-jetty-start.sh new file mode 100755 index 00000000..ebb75d6f --- /dev/null +++ b/eclipse-temurin/9.4/jre21/generate-jetty-start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START + +DRY_RUN=$(/docker-entrypoint.sh "$@" --dry-run | tee /dev/stderr) +DRY_RUN=$(echo "$DRY_RUN" \ + | egrep '[^ ]*java .*org\.eclipse\.jetty\.xml\.XmlConfiguration ' \ + | sed -e 's/ -Djava.io.tmpdir=[^ ]*//g' -e 's/\\$//') +echo "exec $DRY_RUN" > $JETTY_START + +# If jetty.start doesn't have content then the dry-run failed. +if ! [ -s $JETTY_START ]; then + echo "jetty dry run failed:" + echo "$DRY_RUN" | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' + exit 1 +fi From 841f48deb6a85a9e8f0696a08dc6c475f8b0e1ec Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 10 Nov 2023 11:23:50 +1100 Subject: [PATCH 2/3] update the generated tags for java 21 Signed-off-by: Lachlan Roberts --- generate-stackbrew-library.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 7e09bd6c..8fd9350f 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,7 +2,7 @@ set -ueo pipefail shopt -s globstar -defaultJdk="jdk17" +defaultJdk="jdk21" defaultVersions=("12.0" "11.0" "10.0" "9.4") defaultImage="eclipse-temurin" excludedBases=("azul") @@ -19,7 +19,8 @@ isDefaultVersion() { declare -A aliases aliases=( - [eclipse-temurin-12.0-jdk17]='latest jdk17' + [eclipse-temurin-12.0-jdk21]='latest jdk21' + [eclipse-temurin-12.0-jdk17]='jdk17' ) cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" From 5245ca814cb972078d8e5bb6526f183d84f6d283 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 10 Nov 2023 12:04:50 +1100 Subject: [PATCH 3/3] fix jdk21 images Signed-off-by: Lachlan Roberts --- eclipse-temurin/10.0/jdk21/Dockerfile | 2 +- eclipse-temurin/11.0/jdk21/Dockerfile | 2 +- eclipse-temurin/12.0/jdk17/Dockerfile | 2 +- eclipse-temurin/12.0/jdk21/Dockerfile | 2 +- eclipse-temurin/9.4/jdk21/Dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eclipse-temurin/10.0/jdk21/Dockerfile b/eclipse-temurin/10.0/jdk21/Dockerfile index dbd0c709..330977fc 100644 --- a/eclipse-temurin/10.0/jdk21/Dockerfile +++ b/eclipse-temurin/10.0/jdk21/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT. Edit baseDockerfile-slim and use update.sh -FROM eclipse-temurin:21-jdk-focal +FROM eclipse-temurin:21-jdk ENV JETTY_VERSION 10.0.18 ENV JETTY_HOME /usr/local/jetty diff --git a/eclipse-temurin/11.0/jdk21/Dockerfile b/eclipse-temurin/11.0/jdk21/Dockerfile index 5099eb19..ee28516a 100644 --- a/eclipse-temurin/11.0/jdk21/Dockerfile +++ b/eclipse-temurin/11.0/jdk21/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT. Edit baseDockerfile-slim and use update.sh -FROM eclipse-temurin:21-jdk-focal +FROM eclipse-temurin:21-jdk ENV JETTY_VERSION 11.0.18 ENV JETTY_HOME /usr/local/jetty diff --git a/eclipse-temurin/12.0/jdk17/Dockerfile b/eclipse-temurin/12.0/jdk17/Dockerfile index 222f6dbd..41e886eb 100644 --- a/eclipse-temurin/12.0/jdk17/Dockerfile +++ b/eclipse-temurin/12.0/jdk17/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT. Edit baseDockerfile-slim and use update.sh -FROM eclipse-temurin:17-jdk-focal +FROM eclipse-temurin:17-jdk ENV JETTY_VERSION 12.0.3 ENV JETTY_HOME /usr/local/jetty diff --git a/eclipse-temurin/12.0/jdk21/Dockerfile b/eclipse-temurin/12.0/jdk21/Dockerfile index 60c47d4e..1c63b9e1 100644 --- a/eclipse-temurin/12.0/jdk21/Dockerfile +++ b/eclipse-temurin/12.0/jdk21/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT. Edit baseDockerfile-slim and use update.sh -FROM eclipse-temurin:21-jdk-focal +FROM eclipse-temurin:21-jdk ENV JETTY_VERSION 12.0.3 ENV JETTY_HOME /usr/local/jetty diff --git a/eclipse-temurin/9.4/jdk21/Dockerfile b/eclipse-temurin/9.4/jdk21/Dockerfile index 063c8b18..9bc802c4 100644 --- a/eclipse-temurin/9.4/jdk21/Dockerfile +++ b/eclipse-temurin/9.4/jdk21/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT. Edit baseDockerfile-slim and use update.sh -FROM eclipse-temurin:21-jdk-focal +FROM eclipse-temurin:21-jdk ENV JETTY_VERSION 9.4.53.v20231009 ENV JETTY_HOME /usr/local/jetty