diff --git a/Dockerfile b/Dockerfile index 35753224..8705ab44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,23 +10,24 @@ COPY ${DEPENDENCY}/application/ ./ ENV JELU_DATABASE_PATH="/database/" ENV JELU_FILES_DIR="/files/" +ENV JELU_METADATA_CALIBRE_PATH="/calibre/fetch-ebook-metadata" ENV LC_ALL=en_US.UTF-8 -RUN apt-get update \ - && apt-get install --no-install-recommends --yes wget \ - xz-utils \ - xdg-utils \ - libxcb-xinerama0 \ - libxcb-icccm4 \ - libxcb-image0 \ - libxcb-keysyms1 \ - libxcb-render-util0 \ - libxcb-randr0 \ - qt5-default \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin install_dir=/ isolated=y +RUN apt-get update && apt-get install --no-install-recommends --yes wget xz-utils \ + xdg-utils \ + libxcb-xinerama0 \ + libxcb-icccm4 \ + libxcb-image0 \ + libxcb-keysyms1 \ + libxcb-render-util0 \ + libxcb-randr0 \ + qt5-default \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin install_dir=/ isolated=y \ + && curl https://www.mobileread.com/forums/attachment.php\?attachmentid\=182200\&d\=1641360812 > goodreads.zip \ + && /calibre/calibre-customize --add-plugin goodreads.zip \ + && rm goodreads.zip ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=optional:file:/config/"] EXPOSE 11111 diff --git a/Dockerfile-arm b/Dockerfile-arm new file mode 100644 index 00000000..32abb225 --- /dev/null +++ b/Dockerfile-arm @@ -0,0 +1,22 @@ +FROM eclipse-temurin:11.0.13_8-jre-focal + +WORKDIR app + +ARG DEPENDENCY=build/dependency +COPY ${DEPENDENCY}/dependencies/ ./ +COPY ${DEPENDENCY}/spring-boot-loader/ ./ +COPY ${DEPENDENCY}/snapshot-dependencies/ ./ +COPY ${DEPENDENCY}/application/ ./ + +ENV JELU_DATABASE_PATH="/database/" +ENV JELU_FILES_DIR="/files/" +ENV LC_ALL=en_US.UTF-8 +ENV JELU_METADATA_CALIBRE_PATH="/usr/bin/fetch-ebook-metadata" + +RUN apt-get update && apt-get install --no-install-recommends --yes calibre \ + && curl https://www.mobileread.com/forums/attachment.php\?attachmentid\=182200\&d\=1641360812 > goodreads.zip \ + && calibre-customize --add-plugin goodreads.zip \ + && rm goodreads.zip + +ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=optional:file:/config/"] +EXPOSE 11111 diff --git a/ci/docker-common.sh b/ci/docker-common.sh index a74ad05c..cc3e026a 100644 --- a/ci/docker-common.sh +++ b/ci/docker-common.sh @@ -3,7 +3,9 @@ # 2: channel export DOCKER_CLI_EXPERIMENTAL=enabled -PLATFORMS=linux/amd64,linux/arm/v7,linux/arm64/v8 +PLATFORMS=linux/amd64 + +ARM_PLATFORMS=linux/arm/v7,linux/arm64/v8 if [ -z "$2" ]; then DOCKER_CHANNEL="latest" diff --git a/ci/prepare-dockerhub.sh b/ci/prepare-dockerhub.sh index d313ea8c..44a5047d 100755 --- a/ci/prepare-dockerhub.sh +++ b/ci/prepare-dockerhub.sh @@ -15,3 +15,11 @@ docker buildx build \ --tag wabayang/jelu:$DOCKER_CHANNEL \ --tag wabayang/jelu:$1 \ --file ./Dockerfile . + +# build arm +docker buildx build \ + --platform $ARM_PLATFORMS \ + --cache-from wabayang/jelu:$DOCKER_CHANNEL \ + --tag wabayang/jelu:$DOCKER_CHANNEL \ + --tag wabayang/jelu:$1 \ + --file ./Dockerfile . diff --git a/ci/publish-dockerhub.sh b/ci/publish-dockerhub.sh index 6843c8a2..9a196304 100755 --- a/ci/publish-dockerhub.sh +++ b/ci/publish-dockerhub.sh @@ -13,3 +13,12 @@ docker buildx build \ --tag wabayang/jelu:$1 \ --file ./Dockerfile . \ --push + +# push arm +docker buildx build \ + --platform $ARM_PLATFORMS \ + --cache-from wabayang/jelu:$DOCKER_CHANNEL \ + --tag wabayang/jelu:$DOCKER_CHANNEL \ + --tag wabayang/jelu:$1 \ + --file ./Dockerfile . \ + --push