docker1.10.3-jetty8-jersey1.x 构建微服务

本文介绍了如何利用Dockerfile来构建一个基于docker1.10.3的微服务环境,该服务集成了Jetty8 web服务器和jersey1.x作为RESTful API框架。通过这个过程,读者将学习到Dockerfile的编写技巧以及如何部署和运行包含Jetty和Jersey的应用。
摘要由CSDN通过智能技术生成
本项目是将restful项目打包成可执行的war包,在docker中执行

环境介绍:
    docker    1.10.3
    jetty    8
    jersey    1.19

关键配置:
1、pom.xml配置
       
       
       
<build>
<finalName>${project.artifactId} </finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty </groupId>
<artifactId>jetty-maven-plugin </artifactId>
<version>${jetty.version} </version>
<configuration>
<systemProperties>
</systemProperties>
<webApp>
<contextPath>/ </contextPath>
</webApp>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins </groupId>
<artifactId>maven-compiler-plugin </artifactId>
<version>2.5.1 </version>
<configuration>
<source>1.7 </source>
<target>1.7 </target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins </groupId>
<artifactId>maven-source-plugin </artifactId>
<version>2.2 </version>
<executions>
<execution>
<id>attach-sources </id>
<goals>
<goal>jar </goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins </groupId>
<artifactId>maven-dependency-plugin </artifactId>
<version>2.5.1 </version>
<executions>
<execution>
<id>jetty-classpath </id>
<phase>prepare-package </phase>
<goals>
<goal>unpack-dependencies
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值