Remote Access docker in the tomcat, reported 404

Here deployed on Ali cloud server, port 8888 is open, but access times of 404
Here Insert Picture Description

Solution:

  • First docker ps look at the name of the vessel is running, there is a tomcatHere Insert Picture Description
  • By the following command to enter the name of the vessel tomcat directory, where tomcat parameter is found in the above
docker exec -it tomcat /bin/bash

Here Insert Picture Description

  • ls -l look at the file directory
    Here Insert Picture Description
    found a webapps and webapps.dist

And then found the webapps consequently no:
Here Insert Picture Description
and that some things are in the webapps.dist
Here Insert Picture Description

  • Then delete the webapps directory while the webapps.dist webapps directory name changed
rm -rf webapps
mv webapps.dist/ webapps

Here Insert Picture Description
Visit again tomcat, but in order to be a successful visit, so do not rush, be patient, and so on, the final results are as follows:
Here Insert Picture Description

to sum up

I pull this is the latest tomcat mirror, and this is just a test of the emergency mode, because the mirror is the same, run the container again, as is 404, so if we do not change version, still want to use the latest tomcat image , can pull down the mirror to do it again custom, to delete and webapps.dist webapps webapps directory name changed after the operation to do, submit to generate a new image, so that once and for all.

Published 289 original articles · won praise 302 · views 50000 +

Guess you like

Origin blog.csdn.net/weixin_38106322/article/details/105099406