Skip to content

Commit

Permalink
fix: arm images
Browse files Browse the repository at this point in the history
  • Loading branch information
bayang committed Jan 18, 2022
2 parents 6c8d452 + aba9944 commit fbbed72
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 16 deletions.
31 changes: 16 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions Dockerfile-arm
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion ci/docker-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions ci/prepare-dockerhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
9 changes: 9 additions & 0 deletions ci/publish-dockerhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fbbed72

Please sign in to comment.