Docker image build recipe for CPython 2.4.6, mainly for legacy Python 2.4 syntax/compile checks.
This repository builds a small Docker image containing CPython 2.4.6.
The intended use case is checking whether old Python code can still be parsed/compiled by Python 2.4. This is useful for legacy embedded-Python projects such as games (e.g., AdvCiv-SAS), tools, or applications that still depend on Python 2.4.
This image is not meant for modern Python development.
Published GHCR image:
ghcr.io/wonderingabout/python-2.4:2.4.6
Other moving tags:
ghcr.io/wonderingabout/python-2.4:latest
ghcr.io/wonderingabout/python-2.4:YYYY-MM
Example:
docker pull ghcr.io/wonderingabout/python-2.4:2.4.6
docker run --rm ghcr.io/wonderingabout/python-2.4:2.4.6 python -VExpected version:
Python 2.4.6
For long-term CI use, prefer pinning the image by digest instead of using latest or another moving tag.
The GitHub Actions workflow builds and publishes the image when:
- Run manually with
workflow_dispatch Dockerfileor.github/workflows/image-autobuild.ymlchanges onmain- The monthly schedule runs at 03:37 UTC on day 1 of each month
The monthly rebuild is meant to confirm that the build recipe still works and to refresh moving tags.
This image was tested from an AdvCiv-SAS GitHub Actions workflow by running CPython 2.4 against the repository's Python files.
PASS Python 2.4 compile compatibility: checked 235 Python files
A deliberate break test was then added to one file using Python 2.5+ conditional-expression syntax:
SAS_MAGIC_PY24_COMPILE_BREAK_TEST = 1 if True else 0The workflow failed as expected with a Python 2.4 syntax error:
FAIL Python 2.4 compile compatibility
SyntaxError: invalid syntax
This confirms that the image is useful for catching accidental Python syntax that is too new for Python 2.4. It only checks parser/compile compatibility; it does not test runtime imports from an embedded application such as Civ4's CvPythonExtensions.
docker build -t python-2.4:local .
docker run --rm python-2.4:local python -VThe image currently builds CPython 2.4.6 from the official Python.org source archive.
- GPT-5.5 (on Codex)
- ChatGPT-5.5