1. Docker domestic mirror setting
reference is as follows, it is recommended to use Alibaba Cloud mirroring faster
https://9cpn8tt6.mirror.aliyuncs.com
https://registry.docker-cn.com
http://hub-mirror.c.163.com
https://3laho3y3.mirror.aliyuncs.com
http://f1361db2.m.daocloud.io
https://mirror.ccs.tencentyun.com
Note: After setting up, you must restart docker.
2. Install Tomcat
1. Find the tomcat image on Docker Hub:
docker search tomcat
2. Pull the official image
docker pull tomcat
或者
docker pull tomcat[:stars]
3. View all docker images
docker images
4. Start the tomcat mirror
docker run -d -p 8080:8080 tomcat
Specify port: 8080
If it has been started, start the container id, because every time you use the run command, a new container will be started, use the ps command to view the container id, and then execute the command
//查看容器id
docker ps -a
//启动容器
docker start 容器id
5. Stop Tomcat service
docker stop 66282a52c168