Centos uses docker to quickly build a tomcat environment

CentOS Docker Installation | Rookie Tutorial (runoob.com)

Docker install Tomcat | rookie tutorial (runoob.com)

  1. Enter the command to install with one click
curl -fsSL https://get.docker.com | bash -s docker --mirror aliyun
  1. Use docker to pull the official image
docker pull tomcat
  1. View the id of the downloaded mirror
 docker images
  1. Start tomcat, create mapping and mount
docker run --name tomcat -p 8080:8080 -v $PWD/tomcat:/usr/local/tomcat/webapps -d tomcat  

Here the webapps directory in the container is mapped to the tomcat directory under the current directory

  1. Create default ROOT folder
cd tomcat
mkdir ROOT

Move the website files into the ROOT folder

Guess you like

Origin blog.csdn.net/rglkt/article/details/118883116