Production ready Apache Tomcat Java Servlet Application Server
10K+
Production ready Apache Tomcat image: the official Tomcat image (Eclipse Temurin JRE, Ubuntu) with JDBC drivers, monitoring and the most used Java libraries already included, a configurable entrypoint and persistent data management.
| Tags | Tomcat | Java |
|---|---|---|
9.0.X-BUILD, 9.0.X, 9.0, 9, latest | 9.0 | Temurin JRE 11 |
10.1.X-BUILD, 10.1.X, 10.1, 10 | 10.1 | Temurin JRE 17 |
X is the Tomcat patch version, BUILD the build number: see the
tags page for the latest ones.
Images are rebuilt every week with the latest OS security updates, so the X.Y.Z, X.Y and X
tags always point to a patched image; X.Y.Z-BUILD never changes.
Architecture: amd64.
tomcat userInstalled in /usr/local/tomcat/lib (each one can be disabled at build time, see APP_PLUGIN_*):
| Component | Use |
|---|---|
| PostgreSQL JDBC driver | PostgreSQL databases |
| MySQL Connector/J | MySQL / MariaDB databases |
| Microsoft JDBC Driver for SQL Server (jre11) | SQL Server databases |
| JTOpen (jt400) | IBM i (AS/400) databases |
Redisson (redisson-all + redisson-tomcat-<major>) | HTTP sessions stored in Redis |
Glowroot (/usr/local/tomcat/glowroot) | JVM and application monitoring (APM) |
Metro web services (webservices-*), JAXB RI | SOAP web services, XML binding (javax) |
| JavaMail, javax.mail-api, javax.activation-api, jakarta.activation | mail and activation |
Apache POI (poi, poi-ooxml, poi-excelant) | Microsoft Office documents |
Metro, JAXB, JavaMail and the activation APIs are the javax.* versions, for javax applications
(Tomcat 9). Tomcat 10.1 is Jakarta EE (jakarta.*): jakarta applications bring their own libraries
and do not use them.
Tools: mysql / mysqldump client, izmysqlsync,
curl, rsync, lftp, openssh-client, imagemagick, graphviz.
The exact versions of every image are listed in
versions.env, and inside the
container in /usr/src/tomcat/versions.env.
docker run -d --name tomcat -p 8080:8080 izdock/tomcat
Then open http://localhost:8080 (or http://host-ip:8080).
On the first start, when APP_ADMIN_PASSWORD is not set, a random password is generated for the
admin user and printed in the container log (docker logs tomcat).
Set the paths where configuration, webapps and shared files must live, and mount a volume there. On the first start the default content is copied into the empty directories:
docker run -d --name tomcat -p 8080:8080 \
-e APP_ADMIN_USERNAME=admin -e APP_ADMIN_PASSWORD=VeryStrong4ndSecurePWD \
-e APP_CONF=/data/tomcat/conf \
-e APP_DATA=/data/tomcat/webapps \
-e APP_SHARED=/data/tomcat/shared \
-v /srv/tomcat:/data \
izdock/tomcat:9
JAVA_OPTS holds the default JVM options of the image (container aware, UTF-8, headless);
put your own options in CATALINA_OPTS. Example with time zone, heap sizing, JMX and the
Glowroot agent (web UI on port 4000):
docker run -d --name tomcat -p 8080:8080 -p 4000:4000 \
-e TZ=Europe/Rome \
-e CATALINA_OPTS="-XX:MaxRAMPercentage=75.0 -Duser.timezone=Europe/Rome -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -javaagent:/usr/local/tomcat/glowroot/glowroot.jar" \
izdock/tomcat:9
FROM izdock/tomcat:9
COPY ./conf /usr/local/tomcat/conf
COPY ./myapp.war /usr/local/tomcat/webapps/
/opt/tomcat is a link to /usr/local/tomcat.
| Variable | Default | Description |
|---|---|---|
APP_ADMIN_USERNAME | manager | user created in tomcat-users.xml with the manager and admin roles |
APP_ADMIN_PASSWORD | random | its password; when empty a random one is printed in the log |
APP_REMOTE_MANAGEMENT | 1 | 1 allows the Tomcat Manager from any address, 0 keeps the Tomcat default (localhost only) |
JAVA_OPTS | see the image | default JVM options of the image |
CATALINA_OPTS | your JVM and Tomcat options | |
TZ | UTC | container time zone (eg. Europe/Rome) |
UMASK | 0002 | umask of the Tomcat process and of the files it creates |
The configuration hooks (admin user, Manager access, connector limits) run only once: when APP_CONF
is persistent, a .initialized file in it keeps them from running again.
Each variable, when set, moves the directory to that path (a symlink from the default path):
| Variable | Default path |
|---|---|
APP_CONF | /usr/local/tomcat/conf |
APP_DATA | /usr/local/tomcat/webapps |
APP_LOGS | /usr/local/tomcat/logs |
APP_TEMP | /usr/local/tomcat/temp |
APP_WORK | /usr/local/tomcat/work |
APP_SHARED | /usr/local/tomcat/shared (classes, lib, fonts, conf) |
| Variable | Default | Description |
|---|---|---|
APP_RUNAS | true | run Tomcat as the tomcat user (uid/gid 91) |
ENTRYPOINT_TINI | true | run the command through tini |
MULTISERVICE | false | true starts the runit services of /etc/service instead of the command |
CMD_OVERRIDE | command run instead of the default catalina.sh run |
Exposed ports: 8080 (HTTP), 8009 (AJP).
Every component version and its sha256 is in versions.env, the single source of truth of the build. One variant per Tomcat major:
git clone https://github.com/ugoviti/izdock-tomcat.git && cd izdock-tomcat
tools/build.sh 9 # -> izdock/tomcat:local-9
tools/build.sh 10 # -> izdock/tomcat:local-10
To leave out a component, set its APP_PLUGIN_<NAME>=0 in the Dockerfile.
Check upstream for new versions and update versions.env (versions and sha256):
tools/make-updates.sh # report only
tools/make-updates.sh --apply # update versions.env, then build and test
Every component stays on its major version: a new major is only reported. To keep a component on a
given version add <NAME>_PIN=<version> next to its <NAME>_VER in versions.env
(eg. MYSQL_JDBC_PIN=8.2.0) and run tools/make-updates.sh --apply.
Apache Tomcat is released under the Apache License 2.0.
As with all Docker images, this one also contains other software which may be under other licenses (such as Bash and the other packages of the base distribution, and the included Java libraries). As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
Content type
Image
Digest
sha256:d4a4a3eff…
Size
259.4 MB
Last updated
14 days ago
docker pull izdock/tomcat