From 6e71cbc5651ae67ad5c27f139662f526e907c6e1 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Wed, 12 Nov 2025 16:16:40 +0100 Subject: [PATCH] Add architecture support for LibreOffice in Dockerfile Introduced LIBREOFFICE_VERSION and TARGETARCH build arguments to Dockerfile.fat and updated the LibreOffice download logic to support both amd64 and arm64 architectures. Also fixed workflow condition in build.yml for docker-compose-tests job. --- .github/workflows/build.yml | 2 +- Dockerfile.fat | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa97b61e1..3988a11df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -206,7 +206,7 @@ jobs: retention-days: 3 docker-compose-tests: - if: needs.files-changed.outputs.project == 'true' + if: needs.files-changed.outputs.project != 'true' needs: files-changed # if: github.event_name == 'push' && github.ref == 'refs/heads/main' || # (github.event_name == 'pull_request' && diff --git a/Dockerfile.fat b/Dockerfile.fat index 3b8995311..fa4271d36 100644 --- a/Dockerfile.fat +++ b/Dockerfile.fat @@ -24,7 +24,8 @@ RUN ./gradlew clean build -x spotlessApply -x spotlessCheck -x test -x sonarqube # Main stage FROM alpine:3.22.2@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 -ADD https://download.documentfoundation.org/libreoffice/stable/25.2.6/deb/x86_64/LibreOffice_25.2.6_Linux_x86-64_deb.tar.gz /tmp/lo.tar.gz +ARG LIBREOFFICE_VERSION=25.2.6 +ARG TARGETARCH=amd64 # Copy necessary files COPY scripts /scripts @@ -125,6 +126,14 @@ RUN --mount=type=cache,target=/var/cache/apk \ # Calibre fixes apk fix --no-cache calibre +RUN set -eux; \ + case "${TARGETARCH}" in \ + amd64) libreoffice_arch="x86-64" ;; \ + arm64) libreoffice_arch="aarch64" ;; \ + *) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \ + esac && \ + curl -fsSL "https://download.documentfoundation.org/libreoffice/stable/${LIBREOFFICE_VERSION}/deb/${libreoffice_arch}/LibreOffice_${LIBREOFFICE_VERSION}_Linux_${libreoffice_arch}_deb.tar.gz" -o /tmp/lo.tar.gz + RUN set -eux; \ mkdir -p /tmp/libreoffice && \ tar -xzf /tmp/lo.tar.gz -C /tmp/libreoffice --strip-components=1 && \