This is a minimal docker image containing an Apache Tomcat Web Container, based on Alpine Linux. All additional content (docs, default apps, windows executables) is removed to make the image as lightweight as possible.
You can use this image as a base image (
FROM fbrx/tomcat) to run your web app on Apache Tomcat. Simply copy the desired war-file (as war or the exploded directory) to /opt/apache-tomcat-<TOMCAT_VERSION>/. The current working dir is the installation directory of tomcat, so you can just add
ADD my-sample-app.war webapps/ to your Dockerfile.
FROM fbrx/tomcat ADD my-sample-app.war webapps/
The image exposes two ports:
8080- the default http port
8009- the JMX connector port
thanks for your comments, i just added a volume for /opt/apache-tomcat/webapps
Please add APR support to dockerfile.
Binding external volume may be good option:
docker run --name mytomcat -p 127.0.0.1:8080:8080 -v /path/tomcat/webapps:/opt/apache-tomcat/webapps -d fbrx/tomcat