Skip to content

fix(docker): allow PYTHON_VERSION deviating from debian dist version #18389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

3nprob
Copy link
Contributor

@3nprob 3nprob commented May 3, 2025

Pull Request Checklist

Debian bullseye Python version (3.11) overrides build-arg PYTHON_VERSION due to entirety of /usr/local/bin being copied from runtime-deps, thereby removing the base image python installation.

This fixes it by changing the intermediary image to be based on one with the expected PYTHON_VERSION.

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct
    (run the linters)

@3nprob 3nprob force-pushed the docker-fix-python-version branch from d357c02 to 483151c Compare May 3, 2025 03:21
@3nprob 3nprob marked this pull request as ready for review May 3, 2025 03:22
@3nprob 3nprob requested a review from a team as a code owner May 3, 2025 03:22
@3nprob 3nprob force-pushed the docker-fix-python-version branch from 483151c to a622f1e Compare May 6, 2025 07:12
Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian bullseye Python version (3.11) overrides build-arg PYTHON_VERSION due to entirety of /usr/local/bin being copied from runtime-deps, thereby removing the base image python installation.

I'm confused by this statement, the purpose of this stage is only to gather extracted debs into /install-$ARCH, which is then copied into the actual runtime stage

Looking at the Python version in the end image confirms that it has the right version in it:

> docker run --rm --entrypoint='' ghcr.io/element-hq/synapse python --version
Python 3.12.9

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