Issue
I am trying to access tomcat manager app from host. The port publishing is successfull but when trying to access tomcat manager I get 404 error.
This is the command used to launch the tomcat :
docker container run -p 8010:8080 --name mytomcat tomcat:9.0
and trying to access it by url :
http://localhost:8010/manager
From the logs I can confirm that tomcat is running, and I can access it from host system, but when accessing the manager app, 404 is received.
Solution
It turns out that all default tomcat apps have been removed from the webapps
directory for all tomcat images starting with Tomcat version 7.
All apps have been moved to /usr/local/tomcat/webapps.dist
directory so that they are not launched by default. You can read about it here.
If you still want to access those default apps you can copy them back to the webapps directory, if you wish:
FROM tomcat:9.0
RUN mv /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps/
CMD ["catalina.sh","run"]
or copy only the apps that you want. Also you will have to edit tomcat configuration files to not get 403 when accessing those apps.
Answered By - Michał Krzywański