Public Repository

Last pushed: a year ago
Short Description
Tomcat 7 backed by JRE 8u102.
Full Description

Docker Tomcat 7 container

This project is a Tomcat image/container based on Java 8.

The image is configured to work with Maven builds (*.war files) and will automatically deploy them as running apps when the container is launched.

Ports 80 and 443 are exposed.

Environment Variables

TOMCAT_VERSION is the full version to deploy, including the revision. This defaults to 7.0.57.

DEPLOY_DIR is where your *.war files will be located. This is used by the script to auto-load the wars. The default value is /maven.


  • /maven
  • /opt/tomcat/logs
  • /opt/tomcat/work
  • /opt/tomcat/temp
  • /tmp/hsperfdata_root

Of these volumes, the most crucial is /maven, since that's where wars are deployed from. I typically create /opt/maven and then map them at launch time (-v /opt/maven:/maven). The other volumes are only strictly necessary if you want or need persistence.

Example Usage

docker run --name="sometomcat" -v /opt/maven:/maven -v /var/log/tomcat:/opt/tomcat/logs -p 80:80 -p 8443:8443 -d enterbridge/tomcat7

Other Files is the code that looks for *.war files in /maven and copies them into /opt/tomcat/webapps so that they can be automatically deployed.

tomcat-users.xml holds credentials for the host-manager default webapp. Unless modified and rebuilt, the credentials default to admin/admin.

ping.p12 is a self-signed certificate suitable for testing purposes. In production you should replace this with your own SSL certificate.

server.xml is the core configuration file for Tomcat. If you replace the existing SSL certificate with another, you'll need to update this file to reflect not only the new file name, but also the credentials for accessing it. All of these settings are in the "<Connector SSLEnabled="true"" stanza.

postgresql-9.4.1210.jre7.jar is the PostgreSQL connector plugin. Without this, Tomcat cannot connect to the Postgres database.

context.xml contains several key configuration items, including the Postgres connector and filesystem paths for uploads and downloads. All of these must be reconfigured as is appropriate for your environment before starting the container.

Upstream thanks

This image is based heavily on the consol/tomcat-7.0 image, with a few tweaks in the scripts.

Docker Pull Command