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) ----
|
# ---- 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 ----
|
# ---- Build stage: GraalVM 25 + Maven ----
|
||||||
ARG TARGETPLATFORM=linux/arm64
|
FROM ghcr.io/graalvm/native-image-community:25 AS build
|
||||||
FROM --platform=$TARGETPLATFORM ghcr.io/graalvm/native-image-community:25 AS build
|
|
||||||
|
|
||||||
# Copy Maven from the official Maven image — no package installation needed
|
# Copy Maven from the official Maven image — no package installation needed
|
||||||
COPY --from=maven-dist /usr/share/maven /opt/maven
|
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
|
COPY src ./src
|
||||||
RUN mvn -Pnative package -DskipTests
|
RUN mvn -Pnative package -DskipTests
|
||||||
|
|
||||||
# ---- Runtime stage: minimal ARM64 distroless ----
|
# ---- Runtime stage: distroless with glibc + libz (required by GraalVM native binary) ----
|
||||||
FROM --platform=$TARGETPLATFORM gcr.io/distroless/base-nossl-debian12
|
FROM gcr.io/distroless/base-debian12
|
||||||
COPY --from=build /app/target/ai-teacher-backend /app/ai-teacher-backend
|
COPY --from=build /app/target/ai-teacher-backend /app/ai-teacher-backend
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENTRYPOINT ["/app/ai-teacher-backend"]
|
ENTRYPOINT ["/app/ai-teacher-backend"]
|
||||||
|
|||||||
@@ -205,6 +205,15 @@
|
|||||||
<build>
|
<build>
|
||||||
<plugins>
|
<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 -->
|
<!-- GraalVM native-image compilation -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.graalvm.buildtools</groupId>
|
<groupId>org.graalvm.buildtools</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user