try change image building to buildah
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
# ---- Pull Maven from its official image (avoids microdnf under QEMU) ----
|
||||
FROM maven:3.9.9-eclipse-temurin-21 AS maven-dist
|
||||
FROM docker.io/library/maven:3.9.9-eclipse-temurin-21 AS maven-dist
|
||||
|
||||
# ---- Build stage: GraalVM 25 + Maven ----
|
||||
ARG TARGETPLATFORM=linux/arm64
|
||||
FROM --platform=$TARGETPLATFORM ghcr.io/graalvm/native-image-community:25 AS build
|
||||
FROM ghcr.io/graalvm/native-image-community:25 AS build
|
||||
|
||||
# Copy Maven from the official Maven image — no package installation needed
|
||||
COPY --from=maven-dist /usr/share/maven /opt/maven
|
||||
@@ -19,8 +18,8 @@ RUN mvn -Pnative dependency:resolve dependency:resolve-plugins -q
|
||||
COPY src ./src
|
||||
RUN mvn -Pnative package -DskipTests
|
||||
|
||||
# ---- Runtime stage: minimal ARM64 distroless ----
|
||||
FROM --platform=$TARGETPLATFORM gcr.io/distroless/base-nossl-debian12
|
||||
# ---- Runtime stage: distroless with glibc + libz (required by GraalVM native binary) ----
|
||||
FROM gcr.io/distroless/base-debian12
|
||||
COPY --from=build /app/target/ai-teacher-backend /app/ai-teacher-backend
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/app/ai-teacher-backend"]
|
||||
|
||||
+10
-1
@@ -204,7 +204,16 @@
|
||||
<id>native</id>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
|
||||
<!-- skip jib in native builds — use Dockerfile.native + buildah instead -->
|
||||
<plugin>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- GraalVM native-image compilation -->
|
||||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
|
||||
Reference in New Issue
Block a user