Public Repository

Last pushed: 10 months ago
Short Description
Tomcat 7 / Java 8 container that auto-loads .war files.
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.

Port 8080 is 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 deploy-and-run.sh script to auto-load the wars. The default value is /maven.

Volumes

  • /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 8080:8080 -d wkokolis/tomcat7

If you want to hit port 80 rather than 8080, you can use -p 80:8080 when you launch the container.

Other Files

deploy-and-run.sh 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.

Upstream thanks

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

Docker Pull Command
Owner
wkokolis

Comments (0)