From 04dafa4f39cd5218319629555322d5a5b56be4da Mon Sep 17 00:00:00 2001 From: SUSE Update Bot Date: Fri, 25 Oct 2024 20:03:49 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A4=96:=20Update=20build=20recipes=20?= =?UTF-8?q?from=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .obs/workflows.yml | 7 ++ .../Dockerfile.openjdk11 | 76 +++++++++++++++++ .../README.openjdk11.md | 81 +++++++++++++++++++ sac-apache-tomcat-10-image/_multibuild | 1 + sac-apache-tomcat-10-image/_service | 5 ++ 5 files changed, 170 insertions(+) create mode 100644 sac-apache-tomcat-10-image/Dockerfile.openjdk11 create mode 100644 sac-apache-tomcat-10-image/README.openjdk11.md diff --git a/.obs/workflows.yml b/.obs/workflows.yml index 94cc98cb7..6b51ad701 100644 --- a/.obs/workflows.yml +++ b/.obs/workflows.yml @@ -17,6 +17,10 @@ staging_build: source_project: home:defolos:BCI:CR:SLE-15-SP6 source_package: sac-apache-tomcat-10-image target_project: home:defolos:BCI:CR:SLE-15-SP6:Staging + - branch_package: + source_project: home:defolos:BCI:CR:SLE-15-SP6 + source_package: sac-apache-tomcat-10-image + target_project: home:defolos:BCI:CR:SLE-15-SP6:Staging - branch_package: source_project: home:defolos:BCI:CR:SLE-15-SP6 source_package: base-fips-image @@ -234,6 +238,9 @@ refresh_devel_BCI: - trigger_services: project: devel:BCI:SLE-15-SP6 package: sac-apache-tomcat-10-image + - trigger_services: + project: devel:BCI:SLE-15-SP6 + package: sac-apache-tomcat-10-image - trigger_services: project: devel:BCI:SLE-15-SP6 package: base-fips-image diff --git a/sac-apache-tomcat-10-image/Dockerfile.openjdk11 b/sac-apache-tomcat-10-image/Dockerfile.openjdk11 new file mode 100644 index 000000000..a6cd8d835 --- /dev/null +++ b/sac-apache-tomcat-10-image/Dockerfile.openjdk11 @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: MIT + +# Copyright (c) 2024 SUSE LLC + +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. + +# The content of THIS FILE IS AUTOGENERATED and should not be manually modified. +# It is maintained by the BCI team and generated by +# https://github.com/SUSE/BCI-dockerfile-generator + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# You can contact the BCI team via https://github.com/SUSE/bci/discussions + +#!UseOBSRepositories +#!ExclusiveArch: aarch64 x86_64 +#!BuildTag: containers/apache-tomcat:%%tomcat_version%%-openjdk11-%RELEASE% +#!BuildTag: containers/apache-tomcat:%%tomcat_version%%-openjdk11 +#!BuildTag: containers/apache-tomcat:10.1-openjdk11-%RELEASE% +#!BuildTag: containers/apache-tomcat:10.1-openjdk11 +#!ForceMultiVersion +#!BuildName: containers-apache-tomcat-10.1-openjdk11 +#!BuildVersion: %%tomcat_version%% +#!BuildRelease: 55 +FROM registry.suse.com/bci/bci-micro:15.6 AS target +FROM bci/bci-base:15.6 AS builder +COPY --from=target / /target + +RUN set -euo pipefail; \ + zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends tomcat10 curl sed java-11-openjdk java-11-openjdk-headless; \ + zypper -n --installroot /target remove util-linux; \ + zypper -n clean; \ + rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2} +FROM registry.suse.com/bci/bci-micro:15.6 +COPY --from=builder /target / +# Define labels according to https://en.opensuse.org/Building_derived_containers +# labelprefix=com.suse.application.apache-tomcat +LABEL org.opencontainers.image.title="Apache Tomcat" +LABEL org.opencontainers.image.description="Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies." +LABEL org.opencontainers.image.version="%%tomcat_version%%" +LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/apache-tomcat" +LABEL org.opencontainers.image.created="%BUILDTIME%" +LABEL org.opencontainers.image.vendor="SUSE LLC" +LABEL org.opencontainers.image.source="%SOURCEURL%" +LABEL org.opencontainers.image.ref.name="%%tomcat_version%%-openjdk11-%RELEASE%" +LABEL org.opensuse.reference="dp.apps.rancher.io/containers/apache-tomcat:%%tomcat_version%%-openjdk11-%RELEASE%" +LABEL org.openbuildservice.disturl="%DISTURL%" +LABEL com.suse.supportlevel="techpreview" +LABEL com.suse.supportlevel.until="2026-12-31" +LABEL com.suse.eula="sle-eula" +LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15" +LABEL com.suse.release-stage="released" +# endlabelprefix +LABEL org.opencontainers.image.base.name="%BASE_REFNAME%" +LABEL org.opencontainers.image.base.digest="%BASE_DIGEST%" +LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.openjdk11.md" +LABEL io.artifacthub.package.logo-url="https://tomcat.apache.org/res/images/tomcat.png" +ENV TOMCAT_MAJOR="10" +ENV TOMCAT_VERSION="%%tomcat_version%%" +ENV CATALINA_HOME="/usr/share/tomcat" +ENV CATALINA_BASE="/usr/share/tomcat" +ENV PATH="/usr/share/tomcat/bin:$PATH" + +CMD ["/usr/lib/tomcat/server", "start"] +EXPOSE 8080 +RUN set -euo pipefail; mkdir -p /var/log/tomcat; chown --recursive tomcat:tomcat /var/log/tomcat +RUN set -euo pipefail; ln -s /usr/share/tomcat /usr/local/tomcat +RUN set -euo pipefail; \ + sed -i /etc/tomcat/logging.properties \ + -e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = java.util.logging.ConsoleHandler|' \ + -e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.\[/manager\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = java.util.logging.ConsoleHandler|' \ + -e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.\[/host-manager\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = java.util.logging.ConsoleHandler|' + +WORKDIR $CATALINA_HOME +USER tomcat diff --git a/sac-apache-tomcat-10-image/README.openjdk11.md b/sac-apache-tomcat-10-image/README.openjdk11.md new file mode 100644 index 000000000..8a80d2cd6 --- /dev/null +++ b/sac-apache-tomcat-10-image/README.openjdk11.md @@ -0,0 +1,81 @@ +# Tomcat 10 container image +![Support Level](https://img.shields.io/badge/Support_Level-techpreview-blue)[![SLSA](https://img.shields.io/badge/SLSA_(v1.0)-Build_L3-Green)](https://documentation.suse.com/sbp/server-linux/html/SBP-SLSA4/) +[![Provenance: Available](https://img.shields.io/badge/Provenance-Available-Green)](https://documentation.suse.com/container/all/html/Container-guide/index.html#container-verify) + +## Description +Apache Tomcat (Tomcat for short) is a free and open-source implementation of the +Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies. It +provides a pure Java HTTP web server environment that can run Java code. It is a +Java web application server and not a complete JEE application server. + + +## Usage +By default, the image launches Tomcat with the same configuration as the one +that comes with SUSE Linux Enterprise Server. The difference is that logging is +sent to stdout, meaning that the `podman logs tomcat` command displays Tomcat +logs. + +For security reasons, the image runs as the **tomcat** user and is installed +on a micro base container without a package manager. + +To deploy an application, copy the `.war` file into +`$CATALINA_BASE/webapps` (either during a container build or by bind-mounting +the directory), and launch the container using the following command: +```ShellSession +$ podman run -d --rm -p 8080:8080 dp.apps.rancher.io/containers/apache-tomcat:10.1-openjdk11 +``` + +The deployed webapp is then accessible via `http://localhost:8080/$webapp_name`. + + +### How to use the image with rootless Podman + +The container image can be used in rootless mode with Podman. Keep in mind that +Podman remaps the `tomcat` user in the container to a different user on the +host. This user does not have write access to the mounted directory. To avoid +permission issues change permissions of the shared directory to `0777` as +follows: + +```ShellSession +$ chmod 0777 /path/to/my/app +$ podman run --rm -d -v /path/to/my/app:/usr/share/tomcat/webapps:z \ + -p 8080:8080 dp.apps.rancher.io/containers/apache-tomcat:10.1-openjdk11 +``` + + +## Configuration + +The main Tomcat configuration files (for example +`/etc/tomcat/logging.properties`) are stored in `/etc/tomcat/`. + +Tomcat's runtime options can be configured using the environment variables +`JAVA_OPTS` and `CATALINA_OPTS`. `JAVA_OPTS` specifies general options used for +the JVM, whereas `CATALINA_OPTS` specifies Tomcat's flags. You can pass the +options to the container runtime using the `-e` flag: +```ShellSession +$ podman run -it --rm \ + -e JAVA_OPTS="-Xmx1024m" -p 8080:8080 \ + dp.apps.rancher.io/containers/apache-tomcat:10.1-openjdk11 +``` + +The image ships with `CATALINA_HOME` set to `/usr/share/tomcat` +and `CATALINA_BASE` set to `/usr/share/tomcat`. + + +## Upgrading from Tomcat 9 + +Tomcat 9 implements Java EE 8, and Tomcat 10 +implements Jakarta EE 9. Before upgrading from version 9, consult the +[upstream migration guide](https://tomcat.apache.org/migration-10.html). + +## Licensing + +`SPDX-License-Identifier: MIT` + +This documentation and the build recipe are licensed as MIT. +The container itself contains various software components under various open source licenses listed in the associated +Software Bill of Materials (SBOM). + +This image is a tech preview. Do not use it for production. +Your feedback is welcome. +Please report any issues to the [SUSE Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?product=SUSE%20Linux%20Enterprise%20Base%20Container%20Images). diff --git a/sac-apache-tomcat-10-image/_multibuild b/sac-apache-tomcat-10-image/_multibuild index 1775dd524..6dd45d9e4 100644 --- a/sac-apache-tomcat-10-image/_multibuild +++ b/sac-apache-tomcat-10-image/_multibuild @@ -1,4 +1,5 @@ + openjdk11 openjdk17 openjdk21 \ No newline at end of file diff --git a/sac-apache-tomcat-10-image/_service b/sac-apache-tomcat-10-image/_service index e1f982dd4..eb19f8857 100644 --- a/sac-apache-tomcat-10-image/_service +++ b/sac-apache-tomcat-10-image/_service @@ -1,6 +1,11 @@ + + Dockerfile.openjdk11 + %%tomcat_version%% + tomcat10 + Dockerfile.openjdk17 %%tomcat_version%% From 39002a2d6dcdafe0051427739b5a4f274dc6867b Mon Sep 17 00:00:00 2001 From: SUSE Update Bot Date: Fri, 25 Oct 2024 20:54:13 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A4=96:=20Update=20build=20recipes=20?= =?UTF-8?q?from=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sac-apache-tomcat-10-image/Dockerfile.openjdk11 | 2 +- sac-apache-tomcat-10-image/Dockerfile.openjdk17 | 2 +- sac-apache-tomcat-10-image/Dockerfile.openjdk21 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sac-apache-tomcat-10-image/Dockerfile.openjdk11 b/sac-apache-tomcat-10-image/Dockerfile.openjdk11 index a6cd8d835..736ab6116 100644 --- a/sac-apache-tomcat-10-image/Dockerfile.openjdk11 +++ b/sac-apache-tomcat-10-image/Dockerfile.openjdk11 @@ -37,7 +37,7 @@ COPY --from=builder /target / # Define labels according to https://en.opensuse.org/Building_derived_containers # labelprefix=com.suse.application.apache-tomcat LABEL org.opencontainers.image.title="Apache Tomcat" -LABEL org.opencontainers.image.description="Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies." +LABEL org.opencontainers.image.description="The Apache Tomcat software is an open-source implementation of the Jakarta Servlet, Jakarta Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Annotations, and Jakarta Authentication specifications. These specifications are part of the Jakarta EE platform." LABEL org.opencontainers.image.version="%%tomcat_version%%" LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/apache-tomcat" LABEL org.opencontainers.image.created="%BUILDTIME%" diff --git a/sac-apache-tomcat-10-image/Dockerfile.openjdk17 b/sac-apache-tomcat-10-image/Dockerfile.openjdk17 index f9e6611a0..76e5af1ec 100644 --- a/sac-apache-tomcat-10-image/Dockerfile.openjdk17 +++ b/sac-apache-tomcat-10-image/Dockerfile.openjdk17 @@ -37,7 +37,7 @@ COPY --from=builder /target / # Define labels according to https://en.opensuse.org/Building_derived_containers # labelprefix=com.suse.application.apache-tomcat LABEL org.opencontainers.image.title="Apache Tomcat" -LABEL org.opencontainers.image.description="Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies." +LABEL org.opencontainers.image.description="The Apache Tomcat software is an open-source implementation of the Jakarta Servlet, Jakarta Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Annotations, and Jakarta Authentication specifications. These specifications are part of the Jakarta EE platform." LABEL org.opencontainers.image.version="%%tomcat_version%%" LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/apache-tomcat" LABEL org.opencontainers.image.created="%BUILDTIME%" diff --git a/sac-apache-tomcat-10-image/Dockerfile.openjdk21 b/sac-apache-tomcat-10-image/Dockerfile.openjdk21 index c840ba513..fc519bb0d 100644 --- a/sac-apache-tomcat-10-image/Dockerfile.openjdk21 +++ b/sac-apache-tomcat-10-image/Dockerfile.openjdk21 @@ -37,7 +37,7 @@ COPY --from=builder /target / # Define labels according to https://en.opensuse.org/Building_derived_containers # labelprefix=com.suse.application.apache-tomcat LABEL org.opencontainers.image.title="Apache Tomcat" -LABEL org.opencontainers.image.description="Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies." +LABEL org.opencontainers.image.description="The Apache Tomcat software is an open-source implementation of the Jakarta Servlet, Jakarta Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Annotations, and Jakarta Authentication specifications. These specifications are part of the Jakarta EE platform." LABEL org.opencontainers.image.version="%%tomcat_version%%" LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/apache-tomcat" LABEL org.opencontainers.image.created="%BUILDTIME%" From b1e7fa6f3cce05f3c66f8164a69f91d51f7ba4ef Mon Sep 17 00:00:00 2001 From: SUSE Update Bot Date: Mon, 28 Oct 2024 07:48:56 +0000 Subject: [PATCH 3/3] Update changelog for sac-apache-tomcat-10-image --- .../sac-apache-tomcat-10-image.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sac-apache-tomcat-10-image/sac-apache-tomcat-10-image.changes b/sac-apache-tomcat-10-image/sac-apache-tomcat-10-image.changes index 74ec58f9a..7284327f0 100644 --- a/sac-apache-tomcat-10-image/sac-apache-tomcat-10-image.changes +++ b/sac-apache-tomcat-10-image/sac-apache-tomcat-10-image.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 28 07:48:56 UTC 2024 - SUSE Update Bot + +- update description + ------------------------------------------------------------------- Wed Oct 23 10:23:02 UTC 2024 - SUSE Update Bot