From d4497b5a13f29d2038bc09b706d29d88cf4900ba Mon Sep 17 00:00:00 2001 From: dalbodeule <11470513+dalbodeule@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:24:35 +0900 Subject: [PATCH] fix dockerfile again (x1) --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index aba3ab6..fb350c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Builder Stage -FROM gradle:jdk-21-and-22-graal-jammy AS builder +FROM gradle:jdk-21-and-22-graal AS builder # Set working directory WORKDIR /app @@ -14,9 +14,6 @@ COPY gradle.properties . # Download dependencies RUN ./gradlew --no-daemon dependencies -# Build the application -RUN ./gradlew build - # Copy the source code COPY src ./src @@ -24,7 +21,10 @@ COPY src ./src RUN ./gradlew nativeCompile # Runner Stage -FROM alpine:latest AS runner +FROM woahbase/alpine-glibc:latest AS runner + +# Install glibc (required for running Java applications on Alpine) +RUN apk add --no-cache libc6-compat patchelf # Set working directory WORKDIR /app @@ -35,5 +35,8 @@ COPY --from=builder /app/build/native/nativeCompile/chzzk_bot . # Ensure the application binary is executable RUN chmod +x /app/chzzk_bot +# Patch the binary to use the correct dynamic linker +RUN patchelf --set-interpreter /lib/ld-linux-x86-64.so.2 /app/chzzk_bot + # Run the application CMD ["./chzzk_bot"] \ No newline at end of file