This commit is contained in:
32
pom.xml
32
pom.xml
@@ -169,9 +169,11 @@
|
|||||||
<artifactId>jib-maven-plugin</artifactId>
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
<version>3.3.1</version>
|
<version>3.3.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<!-- 【核心修正】基础镜像配置 -->
|
||||||
<from>
|
<from>
|
||||||
<image>openjdk:17-jdk-slim</image>
|
<image>openjdk:17-jdk-slim</image>
|
||||||
</from>
|
</from>
|
||||||
|
<!-- 【核心修正】目标镜像配置 -->
|
||||||
<to>
|
<to>
|
||||||
<image>light-delivery-app</image>
|
<image>light-delivery-app</image>
|
||||||
<tags>
|
<tags>
|
||||||
@@ -179,6 +181,7 @@
|
|||||||
<tag>${project.version}</tag>
|
<tag>${project.version}</tag>
|
||||||
</tags>
|
</tags>
|
||||||
</to>
|
</to>
|
||||||
|
<!-- 【核心修正】容器运行配置 -->
|
||||||
<container>
|
<container>
|
||||||
<ports>
|
<ports>
|
||||||
<port>8080</port>
|
<port>8080</port>
|
||||||
@@ -188,24 +191,29 @@
|
|||||||
<SPRING_PROFILES_ACTIVE>prod</SPRING_PROFILES_ACTIVE>
|
<SPRING_PROFILES_ACTIVE>prod</SPRING_PROFILES_ACTIVE>
|
||||||
</environment>
|
</environment>
|
||||||
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
|
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
|
||||||
<!-- 添加主类配置 -->
|
|
||||||
<mainClass>com.light.delivery.LightApplication</mainClass>
|
<mainClass>com.light.delivery.LightApplication</mainClass>
|
||||||
|
<!-- 可选:添加JVM参数以优化内存 -->
|
||||||
|
<jvmFlags>
|
||||||
|
<jvmFlag>-Djava.security.egd=file:/dev/./urandom</jvmFlag>
|
||||||
|
<jvmFlag>-Xms256m</jvmFlag>
|
||||||
|
<jvmFlag>-Xmx512m</jvmFlag>
|
||||||
|
</jvmFlags>
|
||||||
</container>
|
</container>
|
||||||
<!-- 离线模式配置,确保使用本地已有镜像 -->
|
|
||||||
|
<!-- 【最关键修正】离线模式与本地镜像策略 -->
|
||||||
|
<!-- 1. 强制启用离线模式,禁止所有网络操作 -->
|
||||||
<offline>true</offline>
|
<offline>true</offline>
|
||||||
<!-- 不验证远程仓库 -->
|
<!-- 2. 明确告知Jib直接从本地Docker守护进程获取基础镜像,不进行任何远程检查 -->
|
||||||
|
<useCurrentTimestamp>true</useCurrentTimestamp>
|
||||||
|
|
||||||
|
<!-- 【移除所有可能引发网络检查的冲突配置】 -->
|
||||||
|
<!-- 删除以下行:
|
||||||
<allowInsecureRegistries>true</allowInsecureRegistries>
|
<allowInsecureRegistries>true</allowInsecureRegistries>
|
||||||
<!-- 不拉取父镜像 -->
|
|
||||||
<pullParent>false</pullParent>
|
<pullParent>false</pullParent>
|
||||||
<!-- 镜像标签配置 -->
|
|
||||||
<outputPaths>
|
|
||||||
<tar>${project.build.directory}/jib-image.tar</tar>
|
|
||||||
</outputPaths>
|
|
||||||
<!-- 优化CI/CD构建 -->
|
|
||||||
<containerizingMode>packaged</containerizingMode>
|
<containerizingMode>packaged</containerizingMode>
|
||||||
<!-- 其他优化配置 -->
|
<outputPaths>...<outputPaths>
|
||||||
<skip>false</skip>
|
-->
|
||||||
<useOnlyProjectProperties>true</useOnlyProjectProperties>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
Reference in New Issue
Block a user