Skip to content

[Misc] Download LibreOffice from the Document Foundation archive - #118

Open
manuelleduc wants to merge 1 commit into
masterfrom
libreoffice-download-archive
Open

manuelleduc wants to merge 1 commit into
masterfrom
libreoffice-download-archive

Conversation

@manuelleduc

@manuelleduc manuelleduc commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Jira URL

None, this is a [Misc] change.

Changes

Description

  • The image now downloads LibreOffice from https://downloadarchive.documentfoundation.org/libreoffice/old/<build>/ instead of https://download.documentfoundation.org/libreoffice/stable/<version>/.
  • libreoffice.version in versions.json, and therefore LIBREOFFICE_VERSION in the image, now hold the full 4-part build number (26.2.7.3 instead of 26.2.7). The archive uses it in its paths and file names. The Dockerfile derives the /opt/libreoffice26.2 symlink target from it, so the version stays a single value.
  • updateLibreOffice resolves the highest build of the LTS version from the archive and reads both sha256 from there. It fails when they differ from the sha256 published for the release on the stable directory.
  • The Dockerfiles are regenerated.

Clarifications

  • The official images CI failed on Update XWiki to 18.4.9 docker-library/official-images#22915 (run). xwiki:17 and xwiki:18 failed with curl: (60) SSL certificate OpenSSL verify result: unable to get local issuer certificate on every retry. The other 13 jobs passed with the same base images.
  • The main download site redirects each request to a mirror chosen at random. One of these mirrors has a broken TLS chain, and our retries cannot help when the redirect lands on it. The archive serves the files itself, without a redirect.
  • The archive also keeps every version, while stable/ drops a version once it leaves the stable branch. Older image tags stay rebuildable this way.
  • The archive lists release candidates next to the release (26.2.7.1, 26.2.7.2, 26.2.7.3). The release is the highest build. The sha256 cross-check in updateLibreOffice catches an archive that does not have the release build yet.
  • The archive serves the same bytes as the release: the pinned sha256 values did not change.
  • The value of the LIBREOFFICE_VERSION environment variable exposed by the image changes from 26.2.7 to 26.2.7.3. A script comparing the exact string would notice.

Screenshots & Video

No UI change.

Executed Tests

  • ./gradlew: regenerates the 12 Dockerfiles. Only the LibreOffice lines change.
  • ./gradlew updateLibreOffice: prints LibreOffice is already up to date (26.2.7.3). and leaves versions.json untouched, so the archive and stable/ sha256 match for amd64 and arm64.
  • docker build 18/postgres-tomcat: succeeds. In the image, /opt/libreoffice points to /opt/libreoffice26.2 and soffice --version reports LibreOffice 26.2.7.3, and LIBREOFFICE_VERSION is 26.2.7.3. arm64 was not built locally.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None, this repository has a single branch.

🤖 Generated with Claude Code

@manuelleduc manuelleduc self-assigned this Dec 3, 2026
@manuelleduc
manuelleduc force-pushed the libreoffice-download-archive branch from 769e678 to dd0f2c7 Compare December 3, 2026 15:29
* Download the LibreOffice archives from downloadarchive.documentfoundation.org instead of the main download site. The main site redirects to a random mirror, and a mirror with a broken TLS chain failed the build. The archive serves the files itself and keeps every version.
* Make LIBREOFFICE_VERSION and versions.json hold the full 4-part build number (e.g. 26.2.7.3) used by the archive. The template derives the /opt/libreoffice symlink target from it.
* Make updateLibreOffice resolve the highest build of the LTS version from the archive and read both sha256 from there. It fails when they differ from the sha256 of the release on the stable directory, which catches an archive that only has release candidates yet.
* Regenerate the Dockerfiles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@manuelleduc
manuelleduc force-pushed the libreoffice-download-archive branch from dd0f2c7 to fd47e14 Compare December 3, 2026 15:32
@manuelleduc
manuelleduc requested a review from vmassol December 3, 2026 15:37
@vmassol

vmassol commented Dec 3, 2026

Copy link
Copy Markdown
Member

Thanks for the investigation. I checked that the new URLs serve the files directly (200, no redirect), that the archive sha256 match the pinned values, and that the highest build in the archive is the release (e.g. 26.2.7.1/.2/.3, 25.8.7.1/.2/.3). The diff itself looks correct to me. Some comments:

1. Align with the XWiki Docker test framework (main point)

The test framework in xwiki-platform (ServletContainerExecutor in xwiki-platform-test-docker) downloads LibreOffice from https://download.documentfoundation.org/libreoffice/stable/, i.e. the same host this image used until now. It has the same mirror problem, and handles it with a loop of 5 attempts where each attempt goes back to the redirector, so that a bad mirror only costs one attempt (the extraction is inside the loop too, to also catch truncated archives). Our curl --retry here retries the mirror it was redirected to, which is why it can't escape a broken mirror.

Note that the test framework used downloadarchive.documentfoundation.org in the past and moved away from it in 2022 (xwiki-platform commit a82bef7f21d), partly because "downloadarchive.documentfoundation.org is also very slow and that breaks our build".

Whatever the solution, I think we should use the same mechanism in both places. Either:

  • keep download.documentfoundation.org/libreoffice/stable/ here and do the same as the test framework (retry by going back to the redirector), or
  • move to the archive in both places, after checking that its speed is now acceptable for a ~220 MB download (the framework would then also need to resolve the 4-part build number, as updateLibreOffice now does).

If we keep different mechanisms, the comment that this PR removes ("the same source and version used by the XWiki Docker-based test framework") was a useful guarantee that we'd lose.

2. The archive is a single server

It's a single host (no mirrors), so if it's down or slow, every official image build fails. --retry 5 only covers short outages. This is probably still a better trade-off than random mirrors, but it should be stated, and it's another reason for point 1.

3. ./gradlew release now depends on two hosts

updateLibreOffice is part of the release umbrella and now fails when the archive is unreachable or when its highest build doesn't match the stable/ release. That would block an XWiki image release because of LibreOffice. The mismatch should be rare (the release build is the last RC, which reaches the archive first), but if it happens, logging a warning and keeping the current pin may be better than failing.

4. Tests

Only the "already up to date" path of updateLibreOffice was run. The update path (version change) is unchanged code, so it's probably fine, but it hasn't been exercised with the new version format.

5. LIBREOFFICE_VERSION value change

It goes from 26.2.7 to 26.2.7.3 in the image environment. Worth mentioning in the release notes for anyone whose scripts use it.

6. Minor

  • The reflowed Dockerfile comment leaves a short line in the middle of the paragraph ("...architecture and its sha256. The architecture is read from the image itself with").
  • The commit has two Co-Authored-By lines (Sonnet 5.5 and Opus 5.5).

@manuelleduc

Copy link
Copy Markdown
Member Author

Note that docker-library/official-images#22915 ended up merged even though LO downloading initially failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants