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.
This commit is contained in:
Ludy87
2025-11-12 16:16:40 +01:00
parent c7c35034d0
commit 6e71cbc565
2 changed files with 11 additions and 2 deletions

View File

@@ -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' &&

View File

@@ -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 && \