forked from DaoCloud/docker-demo-java-tomcat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 152a23d
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM base-tomcat-maven:latest | ||
|
||
ADD pom.xml /tmp/build/ | ||
RUN cd /tmp/build && mvn -q dependency:resolve | ||
|
||
ADD src /tmp/build/src | ||
#构建应用 | ||
RUN cd /tmp/build && mvn -q -DskipTests=true package \ | ||
#拷贝编译结果到指定目录 | ||
&& rm -rf $CATALINA_HOME/webapps/* \ | ||
&& mv target/*.war $CATALINA_HOME/webapps/ROOT.war \ | ||
#清理编译痕迹 | ||
&& cd / && rm -rf /tmp/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#docker-demo-java-tomcat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>io.daocloud.demo</groupId> | ||
<artifactId>docker-demo-java-tomcat</artifactId> | ||
<packaging>war</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>docker-demo-java-tomcat Maven Webapp</name> | ||
<url>http://maven.apache.org</url> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<docker.image.prefix>daocloud.io</docker.image.prefix> | ||
</properties> | ||
|
||
<build> | ||
<finalName>docker-demo-java-tomcat</finalName> | ||
<!-- | ||
<plugins> | ||
<plugin> | ||
<groupId>com.spotify</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<version>0.3.6</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<imageName>${docker.image.prefix}/${project.artifactId}</imageName> | ||
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory> | ||
<resources> | ||
<resource> | ||
<targetPath>/</targetPath> | ||
<directory>${project.build.directory}</directory> | ||
<include>${project.build.finalName}.war</include> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
--> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE web-app PUBLIC | ||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | ||
"http://java.sun.com/dtd/web-app_2_3.dtd" > | ||
|
||
<web-app> | ||
<display-name>Archetype Created Web Application</display-name> | ||
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<html> | ||
<body> | ||
<h2>Hello World!</h2> | ||
</body> | ||
</html> |