Skip to content

Commit dda642a

Browse files
authored
Merge pull request #1436 from SUSE/for-deploy-Tumbleweed
🤖: Update build recipes for Tumbleweed
2 parents 5b03055 + d22c2f2 commit dda642a

File tree

19 files changed

+394
-44
lines changed

19 files changed

+394
-44
lines changed

.obs/workflows.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@ staging_build:
1111
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
1212
- branch_package:
1313
source_project: home:defolos:BCI:CR:Tumbleweed
14-
source_package: apache-tomcat-10-image
14+
source_package: apache-tomcat-10-java-17-image
1515
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
1616
- branch_package:
1717
source_project: home:defolos:BCI:CR:Tumbleweed
18-
source_package: apache-tomcat-9-image
18+
source_package: apache-tomcat-10-java-21-image
19+
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
20+
- branch_package:
21+
source_project: home:defolos:BCI:CR:Tumbleweed
22+
source_package: apache-tomcat-10-java-22-image
23+
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
24+
- branch_package:
25+
source_project: home:defolos:BCI:CR:Tumbleweed
26+
source_package: apache-tomcat-9-java-17-image
1927
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
2028
- branch_package:
2129
source_project: home:defolos:BCI:CR:Tumbleweed
@@ -234,10 +242,16 @@ refresh_devel_BCI:
234242
package: alertmanager-image
235243
- trigger_services:
236244
project: devel:BCI:Tumbleweed
237-
package: apache-tomcat-10-image
245+
package: apache-tomcat-10-java-17-image
246+
- trigger_services:
247+
project: devel:BCI:Tumbleweed
248+
package: apache-tomcat-10-java-21-image
249+
- trigger_services:
250+
project: devel:BCI:Tumbleweed
251+
package: apache-tomcat-10-java-22-image
238252
- trigger_services:
239253
project: devel:BCI:Tumbleweed
240-
package: apache-tomcat-9-image
254+
package: apache-tomcat-9-java-17-image
241255
- trigger_services:
242256
project: devel:BCI:Tumbleweed
243257
package: blackbox_exporter-image

apache-tomcat-10-image/apache-tomcat-10-image.changes

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
# Copyright (c) 2024 SUSE LLC
4+
5+
# All modifications and additions to the file contributed by third parties
6+
# remain the property of their copyright owners, unless otherwise agreed
7+
# upon.
8+
9+
# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
10+
# It is maintained by the BCI team and generated by
11+
# https://github.com/SUSE/BCI-dockerfile-generator
12+
13+
# Please submit bugfixes or comments via https://bugs.opensuse.org/
14+
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
15+
16+
17+
#!BuildTag: opensuse/apache-tomcat:10-jre17
18+
#!BuildTag: opensuse/apache-tomcat:10-jre17-%RELEASE%
19+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_version%%-jre17
20+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_version%%-jre17-%RELEASE%
21+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_minor%%-jre17
22+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_minor%%-jre17-%RELEASE%
23+
24+
FROM opensuse/tumbleweed:latest
25+
26+
MAINTAINER openSUSE (https://www.opensuse.org/)
27+
28+
# Define labels according to https://en.opensuse.org/Building_derived_containers
29+
# labelprefix=org.opensuse.application.apache-tomcat
30+
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Apache Tomcat"
31+
LABEL org.opencontainers.image.description="Apache Tomcat container based on the openSUSE Tumbleweed Base Container Image."
32+
LABEL org.opencontainers.image.version="10-jre17"
33+
LABEL org.opencontainers.image.url="https://www.opensuse.org"
34+
LABEL org.opencontainers.image.created="%BUILDTIME%"
35+
LABEL org.opencontainers.image.vendor="openSUSE Project"
36+
LABEL org.opencontainers.image.source="%SOURCEURL%"
37+
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/apache-tomcat:10-jre17-%RELEASE%"
38+
LABEL org.openbuildservice.disturl="%DISTURL%"
39+
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime"
40+
LABEL org.opensuse.release-stage="released"
41+
# endlabelprefix
42+
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/apache-tomcat-10-java-17-image/README.md"
43+
LABEL io.artifacthub.package.logo-url="https://tomcat.apache.org/res/images/tomcat.png"
44+
45+
RUN set -euo pipefail; zypper -n in --no-recommends tomcat10 java-17-openjdk java-17-openjdk-headless; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
46+
ENV TOMCAT_MAJOR="10"
47+
ENV TOMCAT_VERSION="%%tomcat_version%%"
48+
ENV CATALINA_HOME="/usr/share/tomcat"
49+
ENV CATALINA_BASE="/usr/share/tomcat"
50+
ENV PATH="/usr/share/tomcat/bin:$PATH"
51+
52+
CMD ["/usr/libexec/tomcat/server", "start"]
53+
EXPOSE 8080
54+
RUN set -euo pipefail; mkdir -p /var/log/tomcat; chown --recursive tomcat:tomcat /var/log/tomcat;
55+
RUN set -euo pipefail; \
56+
sed -i /etc/tomcat/logging.properties \
57+
-e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = java.util.logging.ConsoleHandler|' \
58+
-e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.\[/manager\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = java.util.logging.ConsoleHandler|' \
59+
-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|'
60+
61+
WORKDIR $CATALINA_HOME
62+
USER tomcat
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Tomcat 10 container image
1+
# Tomcat 10-jre17 container image
22
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)
33

44
## Description
@@ -22,7 +22,7 @@ To deploy an application, copy the `.war` file into
2222
`$CATALINA_BASE/webapps` (either during a container build or by bind-mounting
2323
the directory), and launch the container using the following command:
2424
```ShellSession
25-
$ podman run -d --rm -p 8080:8080 registry.opensuse.org/opensuse/apache-tomcat:10
25+
$ podman run -d --rm -p 8080:8080 registry.opensuse.org/opensuse/apache-tomcat:10-jre17
2626
```
2727

2828
The deployed webapp is then accessible via `http://localhost:8080/$webapp_name`.
@@ -39,7 +39,7 @@ follows:
3939
```ShellSession
4040
$ chmod 0777 /path/to/my/app
4141
$ podman run --rm -d -v /path/to/my/app:/usr/share/tomcat/webapps:z \
42-
-p 8080:8080 registry.opensuse.org/opensuse/apache-tomcat:10
42+
-p 8080:8080 registry.opensuse.org/opensuse/apache-tomcat:10-jre17
4343
```
4444

4545

@@ -55,7 +55,7 @@ options to the container runtime using the `-e` flag:
5555
```ShellSession
5656
$ podman run -it --rm \
5757
-e JAVA_OPTS="-Xmx1024m" -p 8080:8080 \
58-
registry.opensuse.org/opensuse/apache-tomcat:10
58+
registry.opensuse.org/opensuse/apache-tomcat:10-jre17
5959
```
6060

6161
The image ships with `CATALINA_HOME` set to `/usr/share/tomcat`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-------------------------------------------------------------------
2+
Thu Jul 18 10:56:33 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
3+
4+
- First version of the Apache Tomcat 10-jre17 BCI
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
# Copyright (c) 2024 SUSE LLC
4+
5+
# All modifications and additions to the file contributed by third parties
6+
# remain the property of their copyright owners, unless otherwise agreed
7+
# upon.
8+
9+
# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
10+
# It is maintained by the BCI team and generated by
11+
# https://github.com/SUSE/BCI-dockerfile-generator
12+
13+
# Please submit bugfixes or comments via https://bugs.opensuse.org/
14+
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
15+
16+
17+
#!BuildTag: opensuse/apache-tomcat:10-jre21
18+
#!BuildTag: opensuse/apache-tomcat:10-jre21-%RELEASE%
19+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_version%%-jre21
20+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_version%%-jre21-%RELEASE%
21+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_minor%%-jre21
22+
#!BuildTag: opensuse/apache-tomcat:%%tomcat_minor%%-jre21-%RELEASE%
23+
24+
FROM opensuse/tumbleweed:latest
25+
26+
MAINTAINER openSUSE (https://www.opensuse.org/)
27+
28+
# Define labels according to https://en.opensuse.org/Building_derived_containers
29+
# labelprefix=org.opensuse.application.apache-tomcat
30+
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Apache Tomcat"
31+
LABEL org.opencontainers.image.description="Apache Tomcat container based on the openSUSE Tumbleweed Base Container Image."
32+
LABEL org.opencontainers.image.version="10-jre21"
33+
LABEL org.opencontainers.image.url="https://www.opensuse.org"
34+
LABEL org.opencontainers.image.created="%BUILDTIME%"
35+
LABEL org.opencontainers.image.vendor="openSUSE Project"
36+
LABEL org.opencontainers.image.source="%SOURCEURL%"
37+
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/apache-tomcat:10-jre21-%RELEASE%"
38+
LABEL org.openbuildservice.disturl="%DISTURL%"
39+
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime"
40+
LABEL org.opensuse.release-stage="released"
41+
# endlabelprefix
42+
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/apache-tomcat-10-java-21-image/README.md"
43+
LABEL io.artifacthub.package.logo-url="https://tomcat.apache.org/res/images/tomcat.png"
44+
45+
RUN set -euo pipefail; zypper -n in --no-recommends tomcat10 java-21-openjdk java-21-openjdk-headless; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
46+
ENV TOMCAT_MAJOR="10"
47+
ENV TOMCAT_VERSION="%%tomcat_version%%"
48+
ENV CATALINA_HOME="/usr/share/tomcat"
49+
ENV CATALINA_BASE="/usr/share/tomcat"
50+
ENV PATH="/usr/share/tomcat/bin:$PATH"
51+
52+
CMD ["/usr/libexec/tomcat/server", "start"]
53+
EXPOSE 8080
54+
RUN set -euo pipefail; mkdir -p /var/log/tomcat; chown --recursive tomcat:tomcat /var/log/tomcat;
55+
RUN set -euo pipefail; \
56+
sed -i /etc/tomcat/logging.properties \
57+
-e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = java.util.logging.ConsoleHandler|' \
58+
-e 's|org\.apache\.catalina\.core\.ContainerBase\.\[Catalina\]\.\[localhost\]\.\[/manager\]\.handlers =.*|org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = java.util.logging.ConsoleHandler|' \
59+
-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|'
60+
61+
WORKDIR $CATALINA_HOME
62+
USER tomcat
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Tomcat 10-jre21 container image
2+
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)
3+
4+
## Description
5+
Apache Tomcat (Tomcat for short) is a free and open-source implementation of the
6+
Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies. It
7+
provides a pure Java HTTP web server environment that can run Java code. It is a
8+
Java web application server and not a complete JEE application server.
9+
10+
11+
## Usage
12+
By default, the image launches Tomcat with the same configuration as the one
13+
that comes with SUSE Linux Enterprise Server. The difference is that logging is
14+
sent to stdout, meaning that the `podman logs tomcat` command displays Tomcat
15+
logs.
16+
17+
For security reasons, the image runs as the **tomcat** user. This means that
18+
additional packages cannot be installed via `zypper`, unless the user becomes
19+
`root`.
20+
21+
To deploy an application, copy the `.war` file into
22+
`$CATALINA_BASE/webapps` (either during a container build or by bind-mounting
23+
the directory), and launch the container using the following command:
24+
```ShellSession
25+
$ podman run -d --rm -p 8080:8080 registry.opensuse.org/opensuse/apache-tomcat:10-jre21
26+
```
27+
28+
The deployed webapp is then accessible via `http://localhost:8080/$webapp_name`.
29+
30+
31+
### How to use the image with rootless Podman
32+
33+
The container image can be used in rootless mode with Podman. Keep in mind that
34+
Podman remaps the `tomcat` user in the container to a different user on the
35+
host. This user does not have write access to the mounted directory. To avoid
36+
permission issues change permissions of the shared directory to `0777` as
37+
follows:
38+
39+
```ShellSession
40+
$ chmod 0777 /path/to/my/app
41+
$ podman run --rm -d -v /path/to/my/app:/usr/share/tomcat/webapps:z \
42+
-p 8080:8080 registry.opensuse.org/opensuse/apache-tomcat:10-jre21
43+
```
44+
45+
46+
## Configuration
47+
48+
The main Tomcat configuration files (for example
49+
`/etc/tomcat/logging.properties`) are stored in `/etc/tomcat/`.
50+
51+
Tomcat's runtime options can be configured using the environment variables
52+
`JAVA_OPTS` and `CATALINA_OPTS`. `JAVA_OPTS` specifies general options used for
53+
the JVM, whereas `CATALINA_OPTS` specifies Tomcat's flags. You can pass the
54+
options to the container runtime using the `-e` flag:
55+
```ShellSession
56+
$ podman run -it --rm \
57+
-e JAVA_OPTS="-Xmx1024m" -p 8080:8080 \
58+
registry.opensuse.org/opensuse/apache-tomcat:10-jre21
59+
```
60+
61+
The image ships with `CATALINA_HOME` set to `/usr/share/tomcat`
62+
and `CATALINA_BASE` set to `/usr/share/tomcat`.
63+
64+
65+
## Samples
66+
67+
By default, the sample applications shipped with Tomcat are not installed in
68+
the container image. Add them by installing one of the following
69+
packages:
70+
- tomcat10-webapps
71+
- tomcat10-admin-webapps
72+
73+
## Upgrading from Tomcat 9
74+
75+
Tomcat 9 implements Java EE 8, and Tomcat 10
76+
implements Jakarta EE 9. Before upgrading from version 9, consult the
77+
[upstream migration guide](https://tomcat.apache.org/migration-10.html).
78+
79+
## Licensing
80+
81+
`SPDX-License-Identifier: MIT`
82+
83+
This documentation and the build recipe are licensed as MIT.
84+
The container itself contains various software components under various open source licenses listed in the associated
85+
Software Bill of Materials (SBOM).
86+
87+
This image is based on [openSUSE Tumbleweed](https://get.opensuse.org/tumbleweed/).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<services>
2+
<service mode="buildtime" name="docker_label_helper"/>
3+
<service mode="buildtime" name="kiwi_metainfo_helper"/>
4+
<service name="replace_using_package_version" mode="buildtime">
5+
<param name="file">Dockerfile</param>
6+
<param name="regex">%%tomcat_version%%</param>
7+
<param name="package">tomcat10</param>
8+
</service>
9+
<service name="replace_using_package_version" mode="buildtime">
10+
<param name="file">Dockerfile</param>
11+
<param name="regex">%%tomcat_minor%%</param>
12+
<param name="package">tomcat10</param>
13+
<param name="parse-version">minor</param>
14+
</service>
15+
</services>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-------------------------------------------------------------------
2+
Thu Jul 18 10:56:33 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
3+
4+
- First version of the Apache Tomcat 10-jre21 BCI

0 commit comments

Comments
 (0)