Docker Tomcat 8 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.
TOMCAT_VERSION is the full version to deploy, including the revision. This defaults to 8.5.6.
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.
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.
docker run --name="sometomcat" -v /opt/maven:/maven -v /var/log/tomcat:/opt/tomcat/logs -p 8080:8080 -d wkokolis/tomcat8
If you want to hit port 80 rather than 8080, you can use
-p 80:8080 when you launch the container.
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.
This image is based heavily on the consol/tomcat-8.0 image, with a few tweaks in the scripts.