From 8c3ac36473b1ccb5988ab2d5d313ec7a9a399830 Mon Sep 17 00:00:00 2001 From: Clivia <132346501+Yanyutin753@users.noreply.github.com> Date: Sat, 17 Feb 2024 14:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfiles/Dockerfile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Dockerfiles/Dockerfile b/Dockerfiles/Dockerfile index 6a5104a..13efa19 100644 --- a/Dockerfiles/Dockerfile +++ b/Dockerfiles/Dockerfile @@ -1,5 +1,5 @@ # Using Oracle GraalVM for JDK 17 -FROM devatherock/graalvm:21-ol8 AS builder +FROM oracle/graalvm-ce:21.0.0.2 as builder # Set the working directory to /build WORKDIR /build @@ -9,20 +9,17 @@ COPY . /build # Add execute permission to mvnw script and build RUN chmod +x mvnw && \ - ./mvnw --no-transfer-progress native:compile -Pnative && \ + ./mvnw --no-transfer-progress package -Pnative && \ rm -rf /root/.m2 -# Use Distroless as base image -FROM alpine:latest +# Use Scratch as base image +FROM scratch -RUN apk update \ - && apk upgrade \ - && apk add --no-cache tzdata +# Copy the tzdata from builder image +COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo # Copy the native executable into the containers -COPY --from=builder /build/target/gpt-4-copilot /config/gpt-4-copilot +COPY --from=builder /build/target/gpt-4-copilot /gpt-4-copilot # Set the entrypoint -ENTRYPOINT ["/config/gpt-4-copilot"] - - +ENTRYPOINT ["/gpt-4-copilot"]