fix: switch Dockerfile base image from python:3.13 to ubuntu:24.04#14653
Conversation
Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/76620503-6684-4759-a1fb-379890ff7dc8 Co-authored-by: nextcloud-command <88102737+nextcloud-command@users.noreply.github.com>
|
To be closer to official GH runners so we can use the setup python properly. |
|
@skjnldsv: This PR leads the devcontainer unusable for daily development as Ubuntu 24.04 comes with Python 3.12 while the requirement of the dependencies is 3.13 now. Switch to Ubuntu 26.04 instead and resolve the dependency conflict between python3-packaging v26.0 installed by apt repo in 26.04 and There's no php being installed now as well which breaks the |
Thanks, I might have been on the wrong branch when I tested it then. Because it was fine for me. I'll have a look later |
build-pdfCI fails on self-hosted runners becausepython:3.13is Debian 13 ("Trixie")-based, andactions/setup-pythonhas no toolcache binaries for that OS. Switching toubuntu:24.04aligns the container OS with GitHub-hosted runners, where the toolcache entry exists.Changes to
.devcontainer/DockerfileFROM python:3.13→FROM ubuntu:24.04python3 python3-pip python3-venvtoapt-get install(Ubuntu doesn't bundle Python like thepython:image does)FROM ubuntu:24.04 ... && apt-get -y install --no-install-recommends \ ca-certificates curl gnupg2 git lsb-release nano make \ unzip wget \ python3 python3-pip python3-venv \ latexmk texlive-fonts-extra ...No changes to
.github/workflows/sphinxbuild.yml.☑️ Resolves
🖼️ Screenshots
✅ Checklist
codespellor similar and addressed any spelling issuesOriginal prompt
Problem
The
build-pdfCI job fails on self-hosted runners with:This happens because the current
.devcontainer/DockerfileusesFROM python:3.13, which is based on Debian 13 ("Trixie"). Whenactions/setup-pythonruns inside this container, it tries to find a pre-built Python 3.13 binary for Debian 13 in the toolcache manifest — which doesn't exist. It works on official GitHub-hosted runners due to differences in how the runner resolves the container OS.Fix
Switch the Dockerfile base image from
python:3.13toubuntu:24.04to match the GitHub-hosted runner OS. This ensuresactions/setup-pythoncan find its toolcache binaries for Python 3.13 on Ubuntu 24.04, making it work identically on both self-hosted and official runners.Changes to make
Update
.devcontainer/Dockerfile:FROM python:3.13→FROM ubuntu:24.04python3 python3-pip python3-venvto theapt-get installlist (since Ubuntu doesn't bundle Python like the python: image does)The result should look like:
No changes are needed to
.github/workflows/sphinxbuild.yml.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: https://github.com/nextcloud/documentation/actions/runs/24979411774/job/73188827584?pr=14182 fails pdf build on our own runners (which is supposedly mimicking the official gh runners)
But on official gh runners, it works
https://github.com/nextcloud/documentation/actions/runs/24989884443/job/73259325155?pr=14652
Assistant: The root cause is clear. Here's the breakdown:
Root Cause
The
build-pdfjob runs inside a Docker container based onpython:3.13(which is a Debian 13 "Trixie"-based image). Whenactions/setup-pythonruns inside that container, it reads the container's OS and tries to find a pre-compiled Python 3.13 binary for Debian 13 in the actions/python-versions manifest — and it doesn't exist there yet.On the official GitHub-hosted runners, the job apparently runs differently (the passing job log shows it getting through to image-copy steps, suggesting it's potentially running without that container, or that runner environment handles it differently).
The Fix
Since your
python:3.13Docker image already has Python 3.13 installed, you don't needactions/setup-pythonat all in thebuild-pdfjob. Remove it and use the Python already baked into the container:Replace those steps with just:
The
python:3.13base image already provides bothpythonandpip, soactions/setup-pythonis redundant here and actively breaks on self-hosted runners whose Docker daemon reports the container OS as Debian 13 (which lacks pre-built toolcache binaries).Why it works on official runners but not yours: This is likely a version difference in how the runner resolves the container OS label or a subtle difference in the Docker runtime reporting. Either way, the fix (dropping
setup-pythoninside the container) is the correct long-term solution regardless.Us...
This pull request was created from Copilot chat.