Operating a Tomcat Container

Now that the Tomcat container is configured, you can start deploying apps.

Deploy an application

Send a .war to the docker host shared volume (depending on your docker run -v command),


As user from the docker host, enter the tomcatprod container,

docker exec -ti tomcatprod bash

Make sure autodeploy and unpackwars are enabled,

    cd /var/lib/tomcat8/conf/
    grep autoDeploy server.xml
    grep unpackWARs server.xml

Fix the perms, just in case, against the shared volume,

chown -R tomcat8:tomcat8 /tomcatprod

Deploy the .war just by copying it into the webapps folder (tomcat8 will autodeploy),

sudo su - tomcat8
cd ~/webapps/
cp -p ~/apps/sample.war .

TODO check if tomcat8 service needs to be restarted of it understands by itself when it needs to re-deploy.

watch the logs,

    cd /var/lib/tomcat8/logs/
    tail -F -n 100 catalina.out

Docker Operations

See Operating Docker Containers