apache tomcat

Java spp server used for running Java Servlet, JSP, and WebSocket-based applications.


What is apache tomcat

The apache tomcat image packages Apache Tomcat, an open-source Java application server used for running Java Servlet, JSP, and WebSocket-based applications. Tomcat is widely adopted in enterprise environments for deploying lightweight, containerized Java web applications.

This image includes a full Tomcat runtime, a web interface, and tools for deploying .war files to the servlet container. It supports running applications out of the box with minimal configuration and is often used in testing environments, internal services, or legacy application migrations.

The tomcat image is a straightforward way to deploy Java-based applications without managing a full JEE stack like WildFly or WebLogic. It’s useful for developers building or maintaining Java web services that rely on servlets, JSPs, or static content.

How to use this image

The tomcat image runs the Tomcat server and exposes the web interface on port 8080.

Run a default Tomcat server:

‍bashCopyEditdocker run -d -p 8080:8080 tomcat

Deploy a .war file by mounting it into the webapps directory:

‍bashCopyEditdocker run -d -p 8080:8080 \-v $(pwd)/myapp.war:/usr/local/tomcat/webapps/myapp.war \tomcat

Build a custom Tomcat image with your .war file preloaded:

‍DockerfileCopyEditFROM tomcat:10.1COPY ./myapp.war /usr/local/tomcat/webapps/

Logging and ports:

Tomcat logs are printed tostdout and stderr, viewable via docker logs. The main web interface is accessible at http://localhost:8080 by default.

Image variants

The official Tomcat image offers several variants based on version, JDK flavor, and base OS:

‍tomcat:latest

Points to the latest stable Tomcat version (currently Tomcat 10) with the default JDK and Debian base. Use for general-purpose testing or development.

‍tomcat:<version>

Tagged by Tomcat major/minor version (e.g.tomcat:9.0, tomcat:10.1). Use to pin your environment to a specific servlet API version.

‍tomcat:<version>-jdk<xx>

Specifies the JDK version bundled (e.g.tomcat:10.1-jdk17, tomcat:9.0-jdk11). Use when your app targets a specific Java runtime.

‍tomcat:<version>-alpine

Based on Alpine Linux for a smaller image size (e.g.tomcat:10.1-jdk17-temurin-alpine). Use when size and reduced dependencies are priorities.

Versioned tags (e.g.tomcat:10.1.19-jdk17) are recommended for reproducible builds and to avoid unintended upgrades.

Interested in base images that start and stay clean?

This is a not a valid email
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.