docke安装tomcat

这篇博客介绍了如何使用Docker下载Tomcat镜像,拉取并启动最新版本的Tomcat容器,以及如何进入容器进行文件系统操作。重点展示了如何通过`docker run`和`docker exec`命令实现容器的管理和操作。
摘要由CSDN通过智能技术生成

下载tomcat

[root@localhost ~]# docker pull tomcat
Using default tag: latest
latest: Pulling from library/tomcat
1cfaf5c6f756: Pull complete 
c4099a935a96: Pull complete 
f6e2960d8365: Pull complete 
dffd4e638592: Pull complete 
a60431b16af7: Pull complete 
4869c4e8de8d: Pull complete 
9815a275e5d0: Pull complete 
c36aa3d16702: Pull complete 
cc2e74b6c3db: Pull complete 
1827dd5c8bb0: Pull complete 
Digest: sha256:1af502b6fd35c1d4ab6f24dc9bd36b58678a068ff1206c25acc129fb90b2a76a
Status: Downloaded newer image for tomcat:latest
docker.io/library/tomcat:latest
[root@localhost ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
tomcat       latest    266d1269bb29   7 days ago     668MB
nginx        latest    dd34e67e3371   8 days ago     133MB
centos       latest    300e315adb2f   8 months ago   209MB
[root@localhost ~]# 

启动tomcat

[root@localhost ~]# docker run -d -p 3355:8080 --name tomcat01 tomcat
7b2b7ae26c7eec303b2432370d53f975445b9ac324dfa0d381212b489e260594
[root@localhost ~]# 

进入tomcat

[root@localhost ~]# docker exec -it tomcat01 /bin/bash
root@7b2b7ae26c7e:/usr/local/tomcat# ls -al
total 128
drwxr-xr-x. 1 root root    30 Aug 18 20:47 .
drwxr-xr-x. 1 root root    20 Aug 18 20:45 ..
-rw-r--r--. 1 root root 18949 Jul 31 04:12 BUILDING.txt
-rw-r--r--. 1 root root  6210 Jul 31 04:12 CONTRIBUTING.md
-rw-r--r--. 1 root root 57092 Jul 31 04:12 LICENSE
-rw-r--r--. 1 root root  2333 Jul 31 04:12 NOTICE
-rw-r--r--. 1 root root  3372 Jul 31 04:12 README.md
-rw-r--r--. 1 root root  6898 Jul 31 04:12 RELEASE-NOTES
-rw-r--r--. 1 root root 16507 Jul 31 04:12 RUNNING.txt
drwxr-xr-x. 2 root root  4096 Aug 18 20:48 bin
drwxr-xr-x. 1 root root    22 Aug 26 08:58 conf
drwxr-xr-x. 2 root root  4096 Aug 18 20:47 lib
drwxrwxrwx. 1 root root   177 Aug 26 08:58 logs
drwxr-xr-x. 2 root root   134 Aug 18 20:47 native-jni-lib
drwxrwxrwx. 2 root root    30 Aug 18 20:47 temp
drwxr-xr-x. 2 root root     6 Aug 18 20:47 webapps
drwxr-xr-x. 7 root root    81 Jul 31 04:12 webapps.dist
drwxrwxrwx. 2 root root     6 Jul 31 04:12 work
root@7b2b7ae26c7e:/usr/local/tomcat# 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值