Commit fb730dd0 authored by hongguangwu's avatar hongguangwu

MVP1.7.12-解决社保打包问题

parent 87f52fd9
#!/usr/bin/env bash #!/usr/bin/env bash
DOCKER_BUILDKIT=1 mvn clean package -Ptest -Dmaven.test.skip=true docker:build -DpushImage mvn clean package -Ptest -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file \ No newline at end of file
...@@ -126,31 +126,85 @@ ...@@ -126,31 +126,85 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>com.spotify</groupId> <groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId> <artifactId>docker-maven-plugin</artifactId>
<version>1.2.2</version> <version>0.40.2</version>
<configuration> <configuration>
<serverId>docker-hub</serverId> <!-- 认证配置 -->
<!--指定生成的镜像名--> <authConfig>
<imageName>${my.hub.host}/${map.group.name}/${project.artifactId}:${project.version}</imageName> <serverId>docker-hub</serverId>
<dockerDirectory>${project.basedir}/</dockerDirectory> </authConfig>
<!--指定远程 docker api地址-->
<!--<dockerHost>http://172.16.66.232:2375</dockerHost>--> <!-- 镜像配置 -->
<!-- 这里是复制 jar 包到 docker 容器指定目录配置--> <images>
<resources> <image>
<resource> <!--指定生成的镜像名-->
<targetPath>/</targetPath> <name>${my.hub.host}/${map.group.name}/${project.artifactId}:${project.version}</name>
<!--jar 包所在的路径 此处配置的 即对应 target 目录-->
<directory>${project.build.directory}</directory> <!-- 构建配置 -->
<!-- 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 --> <build>
<include>${project.build.finalName}.jar</include> <!-- 保持与原目录一致 -->
</resource> <dockerFileDir>${project.basedir}/</dockerFileDir>
</resources>
<forceTags>true</forceTags> <!-- 等效于原resources配置 -->
<assembly>
<targetDir>/</targetDir>
<descriptorRef>artifact</descriptorRef>
<inline>
<fileSets>
<fileSet>
<!--jar 包所在的路径 此处配置的 即对应 target 目录-->
<directory>${project.build.directory}</directory>
<includes>
<!-- 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 -->
<include>${project.build.finalName}.jar</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
</inline>
</assembly>
<!-- 强制覆盖标签 -->
<tags>
<tag>${project.version}</tag>
</tags>
</build>
<!-- 推送配置 -->
<push>
<enabled>true</enabled>
</push>
</image>
</images>
<!-- 可选:保留原Docker主机配置 -->
<!-- <dockerHost>http://172.16.66.232:2375</dockerHost> -->
</configuration> </configuration>
<!-- 绑定到Maven生命周期 -->
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push-image</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
<resources> <resources>
<resource> <resource>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment