作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想将我的 Web 应用程序部署到在 docker 上运行的 tomcat。我有一个目录“test”,它有两个文件:
-docker.compose.yml
-sample.war
(我从这里下载 https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/
)
这是我的 docker-compose.yml 内容:
my-test:
image: tomcat
ports:
- "8080:8080"
volumes:
- ./hello.war:/usr/local/tomcat/webapps/hello.war
docker-compose up
在“测试”目录中。
http://paste.ubuntu.com/23108774/
docker ps
输出:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
49bf16c1f366 tomcat "catalina.sh run" 12 minutes ago Up 17 seconds 0.0.0.0:8080->8080/tcp test_my-test_1
localhost:8080
然后我只看到Tomcat主页。
localhost:8080/sample
HTTP Status 404 - /sample
type Status report
message /sample
description The requested resource is not available.
Apache Tomcat/8.0.36
最佳答案
您挂载了错误的卷:
- ./hello.war:/usr/local/tomcat/webapps/hello.war
关于docker - 在 tomcat docker 容器上部署 war 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39220006/
我是一名优秀的程序员,十分优秀!