1、搜寻镜像
docker search tomcat
2、下载镜像
docker pull tomcat
3、查看镜像
docker images tomcat
4、运行镜像
docker run -d -p 8080:8080 --name tomcat tomcat:latest
5、拷贝镜像到须要映射的目录
docker cp tomcat:/usr/local/tomcat/conf /usr/app/tomcat/conf
docker cp tomcat:/usr/local/tomcat/logs /usr/app/tomcat/logs
6、应用映射的目录运行 tomcat
docker run -d -p 8080:8080 --name tomcat -v /usr/app/tomcat/webapps:/usr/local/tomcat/webapps -v /usr/app/tomcat/conf:/usr/local/tomcat/conf -v /usr/app/tomcat/logs:/usr/local/tomcat/logs --restart=always tomcat:latest