标签:isp ace import 自动部署 center body dep server osi
1
2
3
4
5
6
7
8
9
10
11
12
13
|
< plugins > < plugin > < groupId >org.apache.tomcat.maven</ groupId > < artifactId >tomcat7-maven-plugin</ artifactId > < version >2.2</ version > < configuration > < server >tomcat</ server > < username >deploy</ username > < password >deploy</ password > </ configuration > </ plugin > </ plugins > |
1
2
3
4
5
|
< server > < id >tomcat</ id > < username >deploy</ username > < password >deploy</ password > </ server > |
1
2
3
|
mkdir -p /usr/local/dockerfile/massive cd /usr/local/dockerfile/massive touch Dockerfile |
1
2
3
|
from tomcat: 7 MAINTAINER massive ADD tomcat-users.xml /usr/local/tomcat/conf/ |
注:tomcat-users.xml可以在tomcat/conf目录找到,拷贝一个到此目录
1
2
3
|
< role rolename = "manager-gui" /> < role rolename = "manager-script" /> < user username = "deploy" password = "deploy" roles = "manager-gui, manager-script" /> |
1
|
docker build -t massive:tomcat . |
1
|
docker run -p 8081 : 8080 massive:tomcat |
1
|
mvn tomcat7:deploy |
web应用会通过tomcat的部署机制拷贝至容器的 /usr/local/tomcat/webapps/${project} 下,当Docker容器关闭后,容器内的改动不会保存至镜像,也就是说拷贝至容器的web应用会在容器关闭后被删除。
1
2
3
4
5
6
7
8
9
10
11
12
13
|
< plugins > < plugin > < groupId >org.apache.tomcat.maven</ groupId > < artifactId >tomcat7-maven-plugin</ artifactId > < version >2.2</ version > < configuration > < server >tomcat</ server > < username >deploy</ username > < password >deploy</ password > </ configuration > </ plugin > </ plugins > |
1
2
3
4
5
|
< server > < id >tomcat</ id > < username >deploy</ username > < password >deploy</ password > </ server > |
1
2
3
|
mkdir -p /usr/local/dockerfile/massive cd /usr/local/dockerfile/massive touch Dockerfile |
1
2
3
|
from tomcat: 7 MAINTAINER massive ADD tomcat-users.xml /usr/local/tomcat/conf/ |
注:tomcat-users.xml可以在tomcat/conf目录找到,拷贝一个到此目录
1
2
3
|
< role rolename = "manager-gui" /> < role rolename = "manager-script" /> < user username = "deploy" password = "deploy" roles = "manager-gui, manager-script" /> |
1
|
docker build -t massive:tomcat . |
1
|
docker run -p 8081 : 8080 massive:tomcat |
1
|
mvn tomcat7:deploy |
web应用会通过tomcat的部署机制拷贝至容器的 /usr/local/tomcat/webapps/${project} 下,当Docker容器关闭后,容器内的改动不会保存至镜像,也就是说拷贝至容器的web应用会在容器关闭后被删除。
使用maven插件自动部署web应用至Docker容器的tomcat
标签:isp ace import 自动部署 center body dep server osi
原文地址:http://www.cnblogs.com/linjiaxin/p/7499285.html