Update Java
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,14 +1,23 @@
|
||||
# Use a specific version of OpenJDK based on Debian ("bullseye" in this case)
|
||||
FROM --platform=$BUILDPLATFORM openjdk:22-ea-21-jdk-slim-bullseye AS builder
|
||||
|
||||
RUN apt update && apt install gradle git && rm -rf /var/lib/apk/* /var/cache/apk/*
|
||||
# Replace 'apk' commands with 'apt-get' for Debian-based package management.
|
||||
# Install required packages such as 'git' and 'gradle'. Remember to update and clean up properly.
|
||||
RUN apt-get update && \
|
||||
apt-get install -y gradle git && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /mxids
|
||||
COPY . .
|
||||
RUN ./gradlew shadowJar
|
||||
|
||||
# Second stage: Setup the runtime container
|
||||
FROM openjdk:22-ea-21-jdk-slim-bullseye
|
||||
|
||||
RUN apt update && apt install bash && rm -rf /var/lib/apk/* /var/cache/apk/*
|
||||
# Again, switch to 'apt-get' for installing 'bash'. Clean up to keep the image size down.
|
||||
RUN apt-get update && \
|
||||
apt-get install -y bash && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
VOLUME /etc/mxids
|
||||
VOLUME /var/mxids
|
||||
@@ -19,8 +28,9 @@ ENV CONF_FILE_PATH="/etc/mxids/mxids.yaml"
|
||||
ENV SIGN_KEY_PATH="/var/mxids/sign.key"
|
||||
ENV SQLITE_DATABASE_PATH="/var/mxids/mxids.db"
|
||||
|
||||
CMD [ "/start.sh" ]
|
||||
|
||||
ADD src/docker/start.sh /start.sh
|
||||
ADD src/script/mxids /app/mxids
|
||||
# It's usually a good practice to use 'COPY' instead of 'ADD' for local files unless you need the extra capabilities of 'ADD' (like auto-extracting tar files).
|
||||
COPY src/docker/start.sh /start.sh
|
||||
COPY src/script/mxids /app/mxids
|
||||
COPY --from=builder /mxids/build/libs/mxids.jar /app/mxids.jar
|
||||
|
||||
CMD ["/start.sh"]
|
||||
|
Reference in New Issue
Block a user