diff --git a/Others/jetty/12.1.3/24.03-lts-sp2/Dockerfile b/Others/jetty/12.1.3/24.03-lts-sp2/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fa3c800eee67195412059fb69b5723ed35767e09 --- /dev/null +++ b/Others/jetty/12.1.3/24.03-lts-sp2/Dockerfile @@ -0,0 +1,42 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp2 +FROM ${BASE} +ARG VERSION=12.1.3 + +RUN dnf update -y \ + && dnf install -y wget git java-17-openjdk shadow-utils \ + && dnf clean all \ + && rm -rf /var/cache/dnf/* + +ENV JETTY_HOME /usr/local/jetty +ENV JETTY_BASE /var/lib/jetty +ENV TMPDIR /tmp/jetty +ENV PATH ${JETTY_HOME}/bin:$PATH + +RUN mkdir -p "$JETTY_HOME" $TMPDIR; \ + cd $JETTY_HOME ; \ + curl -SL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/$VERSION/jetty-home-$VERSION.tar.gz -o jetty.tar.gz ; \ + tar -xvf jetty.tar.gz --strip-components=1 ; \ + sed -i '/jetty-logging/d' etc/jetty.conf ; \ + mkdir -p "$JETTY_BASE" ; \ + cd $JETTY_BASE ; \ + java -jar "$JETTY_HOME/start.jar" --create-startd --add-to-start="server,http,ext,resources,deployment-scanner,ee8-deploy,ee8-webapp" ; \ + groupadd -r jetty && useradd -r -g jetty jetty ; \ + chown -R jetty:jetty "$JETTY_HOME" "$JETTY_BASE" "$TMPDIR" ; \ + usermod -d $JETTY_BASE jetty ; \ + rm -rf /tmp/hsperfdata_root ; \ + rm -fr $JETTY_HOME/jetty.tar.gz* ; \ + java -jar "$JETTY_HOME/start.jar" --list-config + + +WORKDIR $JETTY_BASE + +COPY docker-entrypoint.sh generate-jetty-start.sh / + +RUN chmod +x /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/Others/jetty/12.1.3/24.03-lts-sp2/docker-entrypoint.sh b/Others/jetty/12.1.3/24.03-lts-sp2/docker-entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..c468c3ef4b36084aefb554a0c772b3c8e60192c3 --- /dev/null +++ b/Others/jetty/12.1.3/24.03-lts-sp2/docker-entrypoint.sh @@ -0,0 +1,127 @@ +#!/bin/sh +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Eclipse Public License - v 2.0 + +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-module* |\ + --add-to-start* |\ + --create-files |\ + --create-start-ini |\ + --create-startd |\ + --download |\ + --dry-run |\ + --exec-print |\ + --help |\ + --info |\ + --list-all-modules |\ + --list-classpath |\ + --list-config |\ + --list-modules* |\ + --show-module* |\ + --stop |\ + --update-ini |\ + --version |\ + --write-module-graph* |\ + -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 + + # Search for the Jetty Version comment in the jetty.start file. + JETTY_START_VERSION="$( + grep -m1 '^# JETTY_VERSION:' "$JETTY_START" 2>/dev/null \ + | sed 's/^# JETTY_VERSION: //' + )" + + # If the jetty.start file was generated with a different Jetty version we need to regenerate jetty.start. + if [ "$JETTY_START_VERSION" != "$JETTY_VERSION" ]; then + echo "$(date +'%Y-%m-%d %H:%M:%S'):INFO: Jetty version mismatch ($JETTY_START_VERSION -> $JETTY_VERSION), regenerating jetty.start" >&2 + /generate-jetty-start.sh "$@" + + # If the start.d directory has been modified we need to regenerate jetty.start. + elif [ $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 "$@" \ No newline at end of file diff --git a/Others/jetty/12.1.3/24.03-lts-sp2/generate-jetty-start.sh b/Others/jetty/12.1.3/24.03-lts-sp2/generate-jetty-start.sh new file mode 100644 index 0000000000000000000000000000000000000000..8ab07736895bf2a1ccdd837e5eb50ebc31e348e9 --- /dev/null +++ b/Others/jetty/12.1.3/24.03-lts-sp2/generate-jetty-start.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Eclipse Public License - v 2.0 + +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 "# JETTY_VERSION: $JETTY_VERSION" > "$JETTY_START" +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 \ No newline at end of file diff --git a/Others/jetty/README.md b/Others/jetty/README.md index 54ee90366d85f5a60f84b34611228ec715c6c01c..4dc7b959296b30fb81ba528bd02259dd07c0c697 100644 --- a/Others/jetty/README.md +++ b/Others/jetty/README.md @@ -18,6 +18,7 @@ The tag of each `jetty` docker image is consist of the version of `jetty` and th | Tag | Currently | Architectures | |------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|---------------| +|[12.1.3-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.1.3/24.03-lts-sp2/Dockerfile) | jetty 12.1.3 on openEuler 24.03-LTS-SP2 | amd64, arm64 | | [12.1.1-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.1.1/24.03-lts-sp2/Dockerfile) | Jetty 12.1.1 on openEuler 24.03-LTS-SP2 | amd64, arm64 | | [12.1.0-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.1.0/24.03-lts-sp2/Dockerfile) | Jetty 12.1.0 on openEuler 24.03-LTS-SP2 | amd64, arm64 | | [12.0.21-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.0.21/24.03-lts-sp1/Dockerfile) | Jetty 12.0.21 on openEuler 24.03-LTS-SP1 | amd64, arm64 | diff --git a/Others/jetty/doc/image-info.yml b/Others/jetty/doc/image-info.yml index ee9e24624537a355646e047e278358f92d759e2e..3d20f0b1234649233b239ab4b9d41a8b61a51d98 100644 --- a/Others/jetty/doc/image-info.yml +++ b/Others/jetty/doc/image-info.yml @@ -11,6 +11,7 @@ tags: | | Tag | Currently | Architectures | |------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|---------------| + |[12.1.3-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.1.3/24.03-lts-sp2/Dockerfile) | jetty 12.1.3 on openEuler 24.03-LTS-SP2 | amd64, arm64 | | [12.1.1-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.1.1/24.03-lts-sp2/Dockerfile) | Jetty 12.1.1 on openEuler 24.03-LTS-SP2 | amd64, arm64 | | [12.1.0-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.1.0/24.03-lts-sp2/Dockerfile) | Jetty 12.1.0 on openEuler 24.03-LTS-SP2 | amd64, arm64 | | [12.0.21-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/jetty/12.0.21/24.03-lts-sp1/Dockerfile) | Jetty 12.0.21 on openEuler 24.03-LTS-SP1 | amd64, arm64 | @@ -40,4 +41,4 @@ similar_packages: - Tomcat: Apache Tomcat(简称 Tomcat)是一个轻量级Web服务器和Servlet/JSP容器,它实现了Java Servlet、JSP(JavaServer Pages)和WebSocket规范,是运行Java Web应用的核心服务器之一。 dependency: - openjdk - - maven + - maven \ No newline at end of file diff --git a/Others/jetty/meta.yml b/Others/jetty/meta.yml index 2a50b9acf765d35eb9753abe88a6ed5bf6accc28..8afaca921630c11b3e2fee9e3fe9536b96045f79 100644 --- a/Others/jetty/meta.yml +++ b/Others/jetty/meta.yml @@ -3,4 +3,6 @@ 12.1.0-oe2403sp2: path: 12.1.0/24.03-lts-sp2/Dockerfile 12.1.1-oe2403sp2: - path: 12.1.1/24.03-lts-sp2/Dockerfile \ No newline at end of file + path: 12.1.1/24.03-lts-sp2/Dockerfile +12.1.3-oe2403sp2: + path: 12.1.3/24.03-lts-sp2/Dockerfile \ No newline at end of file