1.查找tomcat docker search tomcat
[root@VM-8-4-centos ~]# docker search tomcat
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
tomcat Apache Tomcat is an open source implementati… 3552 [OK]
tomee Apache TomEE is an all-Apache Java EE certif… 108 [OK]
bitnami/tomcat Bitnami Tomcat Docker Image 48 [OK]
bitnamicharts/tomcat 0
secoresearch/tomcat-varnish Tomcat and Varnish 5.0 0 [OK]
vulhub/tomcat 0
islandora/tomcat 0
wnprcehr/tomcat 0
hivdb/tomcat-with-nucamino 0
sismics/tomcat Apache Tomcat Servlet Container 1
eclipse/rdf4j-workbench Dockerfile for Eclipse RDF4J Server and Work… 6
semoss/docker-tomcat Tomcat, Java, Maven, and Git on top of debian 0 [OK]
eclipse/hadoop-dev Ubuntu 14.04, Maven 3.3.9, JDK8, Tomcat 8 0 [OK]
gbif/ipt The GBIF Integrated Publishing Toolkit (IPT)… 0
dhis2/base-dev Images in this repository contains DHIS2 WAR… 0
eclipse/alpine_jdk8 Based on Alpine 3.3. JDK 1.8, Maven 3.3.9, T… 1 [OK]
misolims/miso-base MySQL 5.7 Database and Tomcat 8 Server neede… 0
dhis2/base Images in this repository contains DHIS2 WAR… 0
jelastic/tomcat An image of the Tomcat Java application serv… 4
cfje/tomcat-resource Tomcat Concourse Resource 2
rightctrl/tomcat CentOS , Oracle Java, tomcat application ssl… 7 [OK]
amd64/tomcat Apache Tomcat is an open source implementati… 6
arm64v8/tomcat Apache Tomcat is an open source implementati… 8
softwareplant/tomcat Tomcat images for jira-cloud testing 0 [OK]
tomcatengineering/pg_backup_rotated Clone of martianrock/pg_backup_rotated but w… 0
2.下载tomcat
docker pull tomcat
[root@VM-8-4-centos ~]# docker pull tomcat
Using default tag: latest
latest: Pulling from library/tomcat
0e29546d541c: Pull complete
9b829c73b52b: Pull complete
cb5b7ae36172: Pull complete
6494e4811622: Pull complete
668f6fcc5fa5: Pull complete
dc120c3e0290: Pull complete
8f7c0eebb7b1: Pull complete
77b694f83996: Pull complete
0f611256ec3a: Pull complete
4f25def12f23: Pull complete
Digest: sha256:9dee185c3b161cdfede1f5e35e8b56ebc9de88ed3a79526939701f3537a52324
Status: Downloaded newer image for tomcat:latest
docker.io/library/tomcat:latest
3.创建容器并启动
docker run -d -p 8082:8080 --name Tomcat01 tomcat
现在访问一下主机的8082端口:
发现确实已经启动了tomcat,但是没有页面
这是因为从阿里云上下载的镜像是最小的镜像,把不必要的东西都剔除掉了
接下来进入tomcat内部查看一下
[root@VM-8-4-centos ~]# docker exec -it Tomcat01 /bin/bash root@73d65ea43f67:/usr/local/tomcat# ls BUILDING.txt CONTRIBUTING.md LICENSE NOTICE README.md RELEASE-NOTES RUNNING.txt bin conf lib logs native-jni-lib temp webapps webapps.dist work root@73d65ea43f67:/usr/local/tomcat# cd webapps root@73d65ea43f67:/usr/local/tomcat/webapps# ls root@73d65ea43f67:/usr/local/tomcat/webapps# cd ../webapps.dist root@73d65ea43f67:/usr/local/tomcat/webapps.dist# ls ROOT docs examples host-manager manager root@73d65ea43f67:/usr/local/tomcat/webapps.dist# cp -r * ../webapps root@73d65ea43f67:/usr/local/tomcat/webapps.dist# cd ../webapps root@73d65ea43f67:/usr/local/tomcat/webapps# ls ROOT docs examples host-manager manager
上述命令把webapps.dist目录下的网站复制到了webapps目录下,现在应该能够访问tomcat页面了:
没有问题。
(本文仅作个人学习记录用,如有纰漏敬请指正)
标签:Pull,Tomcat,tomcat,部署,webapps,Docker,root,complete From: https://www.cnblogs.com/jmsstudy/p/17465369.html