docker 打包配置
This commit is contained in:
parent
dfee61b6af
commit
14069c1bee
51
pom.xml
51
pom.xml
@ -52,8 +52,36 @@
|
|||||||
|
|
||||||
<!--SpringDoc-->
|
<!--SpringDoc-->
|
||||||
<springdoc.version>2.2.0</springdoc.version>
|
<springdoc.version>2.2.0</springdoc.version>
|
||||||
|
|
||||||
|
<!--Docker打包配置-->
|
||||||
|
<!-- <docker.repository.url>10.10.10.200:5000</docker.repository.url>-->
|
||||||
|
<!-- <docker.registry.name>skcks.cn</docker.registry.name>-->
|
||||||
|
<!-- <docker.registry.username>XXX</docker.registry.username>-->
|
||||||
|
<!-- <docker.registry.password>XXX</docker.registry.password>-->
|
||||||
|
<docker.maven.plugin.version>1.4.13</docker.maven.plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>jar</id>
|
||||||
|
<properties>
|
||||||
|
<skip.docker>true</skip.docker>
|
||||||
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>docker</id>
|
||||||
|
<properties>
|
||||||
|
<skip.docker>false</skip.docker>
|
||||||
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -150,6 +178,29 @@
|
|||||||
<build>
|
<build>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>dockerfile-maven-plugin</artifactId>
|
||||||
|
<version>${docker.maven.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default</id>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<skip>${skip.docker}</skip>
|
||||||
|
<repository>skcks.cn/gb28181-docking-platform</repository>
|
||||||
|
<tag>${project.version}</tag>
|
||||||
|
<buildArgs>
|
||||||
|
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
|
||||||
|
</buildArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.mybatis.generator</groupId>
|
<groupId>org.mybatis.generator</groupId>
|
||||||
<artifactId>mybatis-generator-maven-plugin</artifactId>
|
<artifactId>mybatis-generator-maven-plugin</artifactId>
|
||||||
|
13
starter/Dockerfile
Normal file
13
starter/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM eclipse-temurin:17-jdk
|
||||||
|
|
||||||
|
MAINTAINER Shikong <919411476@qq.com>
|
||||||
|
|
||||||
|
ENV HOME_PATH /opt/gb28181-docking-platform/
|
||||||
|
RUN mkdir -p $HOME_PATH
|
||||||
|
WORKDIR $HOME_PATH
|
||||||
|
|
||||||
|
ADD target/starter.jar /opt/gb28181-docking-platform/starter.jar
|
||||||
|
|
||||||
|
EXPOSE 28181
|
||||||
|
|
||||||
|
ENTRYPOINT ["java", "-jar","/opt/gb28181-docking-platform/starter.jar"]
|
@ -90,8 +90,16 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>dockerfile-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<tag>${project.version}</tag>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
Loading…
Reference in New Issue
Block a user