Update Dockerfile

This commit is contained in:
Clivia
2024-02-16 20:59:55 +08:00
committed by GitHub
parent 805ff283ad
commit 778bb64692

View File

@@ -4,14 +4,16 @@ FROM container-registry.oracle.com/graalvm/native-image:21-ol8 AS builder
# Set the working directory to /home/app # Set the working directory to /home/app
WORKDIR /build WORKDIR /build
# Copy the source code into the image for building # Copy the pom.xml file and download dependencies
COPY . /build COPY pom.xml .
RUN ./mvnw dependency:go-offline
# Add execute permission to mvnw script # Copy the rest of the source code
RUN chmod +x mvnw COPY . .
# Build # Add execute permission to mvnw script and build
RUN ./mvnw --no-transfer-progress native:compile -Pnative RUN chmod +x mvnw && \
./mvnw --no-transfer-progress native:compile -Pnative
# The deployment Image # The deployment Image
FROM container-registry.oracle.com/os/oraclelinux:8-slim FROM container-registry.oracle.com/os/oraclelinux:8-slim