FROM java:8 MAINTAINER liuhao EXPOSE 8080 ADD springboot-demo-0.0.1-SNAPSHOT.jar app.jar RUN bash -c ‘touch /app.jar‘ ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>com.ipems.robot.publicService.PublicServiceApp</mainClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
<build> <plugins> <!--打jar包--> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--值为true是指打包时包含scope为system的第三方Jar包--> <includeSystemScope>true</includeSystemScope> </configuration> </plugin> </plugins> </build>
docker发布springboot项目(含多模块化springboot项目)
原文:https://www.cnblogs.com/demon7715/p/12924713.html