Docker】从零开始:13.Docker安装Tomcat
- 下载Tomcat镜像
- 启动Tomcat镜像
- 新版本Tomcat修改
- 访问Tomact首页
下载Tomcat镜像
[root@docker ~]
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
[root@docker ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat latest fb5657adc892 23 months ago 680MB
[root@docker ~]
启动Tomcat镜像
[root@docker ~]
3b44ad54e93b0a0c0b7d4c92bfdcce8c9189efae8bfbaf6f0701545bac2f6b07
[root@docker ~]
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3b44ad54e93b tomcat "catalina.sh run" 9 seconds ago Up 8 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp tomcat
[root@docker ~]
新版本Tomcat修改
- 新版本Tomcat webapps为空 原webapps目录移动至 webapps.dist下,所以我们要进行处理
[root@docker ~]
root@3b44ad54e93b:/usr/local/tomcat
total 132
-rw-r--r--. 1 root root 18994 Dec 2 2021 BUILDING.txt
-rw-r--r--. 1 root root 6210 Dec 2 2021 CONTRIBUTING.md
-rw-r--r--. 1 root root 60269 Dec 2 2021 LICENSE
-rw-r--r--. 1 root root 2333 Dec 2 2021 NOTICE
-rw-r--r--. 1 root root 3378 Dec 2 2021 README.md
-rw-r--r--. 1 root root 6905 Dec 2 2021 RELEASE-NOTES
-rw-r--r--. 1 root root 16517 Dec 2 2021 RUNNING.txt
drwxr-xr-x. 2 root root 4096 Dec 22 2021 bin
drwxr-xr-x. 1 root root 22 Dec 5 04:55 conf
drwxr-xr-x. 2 root root 4096 Dec 22 2021 lib
drwxrwxrwx. 1 root root 80 Dec 5 04:55 logs
drwxr-xr-x. 2 root root 159 Dec 22 2021 native-jni-lib
drwxrwxrwx. 2 root root 30 Dec 22 2021 temp
drwxr-xr-x. 2 root root 6 Dec 22 2021 webapps
drwxr-xr-x. 7 root root 81 Dec 2 2021 webapps.dist
drwxrwxrwx. 2 root root 6 Dec 2 2021 work
root@3b44ad54e93b:/usr/local/tomcat
root@3b44ad54e93b:/usr/local/tomcat
root@3b44ad54e93b:/usr/local/tomcat
访问Tomact首页