mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
fix dockerfile again (x1)
This commit is contained in:
parent
20f6d84040
commit
d4497b5a13
13
Dockerfile
13
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Builder Stage
|
# Builder Stage
|
||||||
FROM gradle:jdk-21-and-22-graal-jammy AS builder
|
FROM gradle:jdk-21-and-22-graal AS builder
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -14,9 +14,6 @@ COPY gradle.properties .
|
|||||||
# Download dependencies
|
# Download dependencies
|
||||||
RUN ./gradlew --no-daemon dependencies
|
RUN ./gradlew --no-daemon dependencies
|
||||||
|
|
||||||
# Build the application
|
|
||||||
RUN ./gradlew build
|
|
||||||
|
|
||||||
# Copy the source code
|
# Copy the source code
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
|
|
||||||
@ -24,7 +21,10 @@ COPY src ./src
|
|||||||
RUN ./gradlew nativeCompile
|
RUN ./gradlew nativeCompile
|
||||||
|
|
||||||
# Runner Stage
|
# 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
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -35,5 +35,8 @@ COPY --from=builder /app/build/native/nativeCompile/chzzk_bot .
|
|||||||
# Ensure the application binary is executable
|
# Ensure the application binary is executable
|
||||||
RUN chmod +x /app/chzzk_bot
|
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
|
# Run the application
|
||||||
CMD ["./chzzk_bot"]
|
CMD ["./chzzk_bot"]
|
Loading…
x
Reference in New Issue
Block a user