feat(docker): enable jpeg-xl support for linux/amd64

This commit is contained in:
Gauthier Roebroeck 2023-07-20 10:41:50 +08:00
parent fc28c521a4
commit 466e980423

View file

@ -1,9 +1,17 @@
FROM eclipse-temurin:17-jre as builder
FROM eclipse-temurin:19-jre as builder
ARG JAR={{distributionArtifactFile}}
COPY assembly/* /
RUN java -Djarmode=layertools -jar ${JAR} extract
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:19-jre
# Install libjxl on x64 only. Homebrew is not available on other architectures.
RUN if [ "`uname -m`" = "x86_64" ]; then \
apt -y update && \
apt -y install git gcc && \
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \
brew install jpeg-xl; fi
VOLUME /tmp
VOLUME /config
WORKDIR app
@ -13,6 +21,7 @@ COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder application/ ./
ENV KOMGA_CONFIGDIR="/config"
ENV LC_ALL=en_US.UTF-8
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"]
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/linuxbrew/.linuxbrew/lib/"
ENTRYPOINT ["java", "--enable-preview", "--enable-native-access=ALL-UNNAMED", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:/config/"]
EXPOSE 25600
LABEL org.opencontainers.image.source="https://github.com/gotson/komga"