|
@@ -72,6 +72,29 @@
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
</plugin>
|
|
|
+ <!-- 添加docker-maven插件 -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>com.spotify</groupId>
|
|
|
+ <artifactId>docker-maven-plugin</artifactId>
|
|
|
+ <configuration>
|
|
|
+ <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
|
|
|
+ <imageTags>
|
|
|
+ <imageTag>${project.version}</imageTag>
|
|
|
+ <imageTag>latest</imageTag>
|
|
|
+ </imageTags>
|
|
|
+ <forceTags>true</forceTags>
|
|
|
+ <!--镜像的FROM,使用java官方镜像-->
|
|
|
+ <baseImage>java:8u111-jdk</baseImage>
|
|
|
+ <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
|
|
|
+ <resources>
|
|
|
+ <resource>
|
|
|
+ <targetPath>/</targetPath>
|
|
|
+ <directory>${project.build.directory}</directory>
|
|
|
+ <include>${project.build.finalName}.jar</include>
|
|
|
+ </resource>
|
|
|
+ </resources>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
</plugins>
|
|
|
</build>
|
|
|
|