Fixed
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m30s

This commit is contained in:
Melaine Gérard 2024-11-21 21:02:15 +01:00
parent ce14efb6a6
commit 0de7fde918

View File

@ -1,9 +1,26 @@
FROM eclipse-temurin:21-alpine AS pre-build
ENV JAVA_HOME=/opt/jdk/jdk-21.0.1+12
ENV PATH=$JAVA_HOME/bin:$PATH
ADD https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_alpine-linux_hotspot_21.0.1_12.tar.gz /opt/jdk/
RUN tar -xzvf /opt/jdk/OpenJDK21U-jdk_x64_alpine-linux_hotspot_21.0.1_12.tar.gz -C /opt/jdk/
RUN ["jlink", "--compress=2", \
"--module-path", "/opt/jdk/jdk-21.0.1+12/jmods/", \
"--add-modules", "java.base,java.logging,java.naming,java.desktop,jdk.unsupported", \
"--no-header-files", "--no-man-pages", \
"--output", "/kiss-runtime"]
FROM eclipse-temurin:21-alpine AS build FROM eclipse-temurin:21-alpine AS build
WORKDIR /src WORKDIR /src
COPY . . COPY . .
RUN ./gradlew clean shadowJar RUN ./gradlew clean shadowJar
FROM eclipse-temurin:21-alpine AS runner
FROM alpine:latest AS runner
COPY --from=pre-build /kiss-runtime /opt/jdk
ENV PATH=$PATH:/opt/jdk/bin
RUN mkdir -p /app RUN mkdir -p /app
WORKDIR /app WORKDIR /app
COPY --from=build /src/build/libs/kiss-shot-acerola.jar /app/kiss-shot-acerola.jar COPY --from=build /src/build/libs/kiss-shot-acerola.jar /app/kiss-shot-acerola.jar