Hello,
When running Tomcat in a Docker container as non-root, I'm getting an
error entry in the logs:
Unable to create directory for deployment:
[/usr/local/tomcat/conf/Catalina/localhost]
I traced this down to the aforementioned directory not being there when
Tomcat gets launched and the user running Tomcat does not having the
permissions to create the directory.
I also traced where this error message is coming from and its due to the
createDirs attribute on the host declaration in server.xml not being set
to false. The docs for the createDirs property states that if its set to
true (the default) it'll attempt to create some directories, log an
error when it fails, but the failure wont stop the startup of Tomcat.
But what I cannot find anywhere is why those directories are created in
the first place and what the ramifications are of them not being created
when createDirs is set to false.
This question is for Tomcat docker images in general (in order to
determine whether generic Tomcat Docker images should do something
different to prevent these Errors in the logs), in my specific scenario
however I'm running one webapp: an exploded WAR in the webapps/ROOT
directory, which comes with its on context.xml in
/webapps/ROOT/META-INF/context.xml
TIA
Paul
--
This email has been checked for viruses by AVG.
https://www.avg.com