Install Multiple Python Versions in the Image #181
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#158
This is an alternative implementation to #175
This just focuses on getting multiple Python interpreter versions into the image. There will be a follow-up PR with the API changes. The goal for the API is for users to be able to pass an arbitrary path to an executable binary (e.g. a path to a different Python interpreter).
See the changes in .github/CONTRIBUTING.md for an overview of how multiple Python versions are managed.
I observed smaller sizes (~70 MB) on Debian 12 (bookworm), but I've had trouble with test failures on bookworm, so the image remains on Debian 11 (buster) for now. About a third of the size seems to be occupied by the shared library.
If anyone knows of additional compiler flags or configuration options to bring down the size, please share!
Each Python interpreter build takes around 6 minutes, and that's with full optimisation enabled. Thankfully each build stage can run in parallel.