1.从阿里云pull下来的Tomcat最新版有一定缺陷 需要稍稍修改一下。 2.首先创建一个Tomcat容器
docker run -d -p:8080:8080 tomcat
3.查看是否创建成功
root@master ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a2de9353e290 mysql "docker-entrypoint..." 5 seconds ago Up 4 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp hardcore_austin
d4cc163ca1e0 tomcat "catalina.sh run" 59 seconds ago Up 58 seconds 0.0.0.0:8080->8080/tcp adoring_davinci
4.进入Tomcat容器
docker exec -it d4cc163ca1e0 /bin/bash
5.查看文件
root@d4cc163ca1e0:/usr/local/tomcat# ls -l
total 132
-rw-r--r-- 1 root root 19004 Feb 21 19:36 BUILDING.txt
-rw-r--r-- 1 root root 6210 Feb 21 19:36 CONTRIBUTING.md
-rw-r--r-- 1 root root 60269 Feb 21 19:36 LICENSE
-rw-r--r-- 1 root root 2333 Feb 21 19:36 NOTICE
-rw-r--r-- 1 root root 3378 Feb 21 19:36 README.md
-rw-r--r-- 1 root root 6905 Feb 21 19:36 RELEASE-NOTES
-rw-r--r-- 1 root root 16517 Feb 21 19:36 RUNNING.txt
drwxr-xr-x 2 root root 4096 Mar 2 11:07 bin
drwxr-xr-x 1 root root 22 Mar 14 07:12 conf
drwxr-xr-x 2 root root 4096 Mar 2 11:07 lib
drwxrwxrwx 1 root root 80 Mar 14 07:12 logs
drwxr-xr-x 2 root root 159 Mar 2 11:07 native-jni-lib
drwxrwxrwx 2 root root 30 Mar 2 11:07 temp
drwxr-xr-x 2 root root 6 Mar 2 11:07 webapps
drwxr-xr-x 7 root root 81 Feb 21 19:36 webapps.dist
drwxrwxrwx 2 root root 6 Feb 21 19:36 work
6.删除webapps文件,因为这个文件内容为空
rm -rf webapps
7.把webapps.dist文件更名为webapps
mv webapps.dist webapps
8.成功访问
|