Description
When using the python:3.14-trixie image (non-slim variant), multiple Python versions are present in the final image due to the use of buildpack-deps:trixie as the base image.
In addition to the requested Python version provided by the Dockerfile, Debian-packaged Python versions are also installed via APT, which can lead to ambiguity and unexpected behavior when tools rely on /usr/bin/python3 or python3 from PATH.
Observed Behavior
The python:3.14-trixie image contains at least the following Python installations:
- Python 3.13.5-1 from the Debian
python3 package
- Python 3.13.5-2 from the Debian
python3.13 package
- Python 3.14.x installed by the Dockerfile under
/usr/local
This happens because buildpack-deps:trixie pulls in Debian’s default Python packages as part of its dependency set.
As a result:
/usr/bin/python3 points to Debian’s Python (3.13)
/usr/local/bin/python3 points to the requested Python (3.14)
- Some tooling and scripts may accidentally pick up the wrong interpreter
Expected Behavior
Ideally, the image would:
- Contain only one Python version, or
- At least not include competing Debian-provided Python interpreters by default
This would reduce ambiguity and make the runtime behavior more predictable, especially for build tools, virtual environments, and scripts that assume a single python3.
Reference
Dockerfile in question:
https://github.com/docker-library/python/blob/master/3.14/trixie/Dockerfile
Questions / Discussion Points
- Is it feasible to use
debian:trixie as the base image for the non-slim variant as well (similar to how the slim images are built), instead of buildpack-deps?
- Alternatively, would it be acceptable to explicitly remove Debian’s
python3 / python3.13 packages in the Dockerfile after the build dependencies are installed?
- Is the presence of multiple Python versions in
python:*-trixie considered expected and stable behavior going forward?
I understand that buildpack-deps is intentionally “heavy” and optimized for build scenarios, but the resulting multiple Python installations are somewhat surprising from a runtime image consumer’s perspective.
Happy to provide a minimal reproducer or test case if that helps.
Thanks for maintaining the official Python images 🙏
Description
When using the
python:3.14-trixieimage (non-slim variant), multiple Python versions are present in the final image due to the use ofbuildpack-deps:trixieas the base image.In addition to the requested Python version provided by the Dockerfile, Debian-packaged Python versions are also installed via APT, which can lead to ambiguity and unexpected behavior when tools rely on
/usr/bin/python3orpython3from PATH.Observed Behavior
The
python:3.14-trixieimage contains at least the following Python installations:python3packagepython3.13package/usr/localThis happens because
buildpack-deps:trixiepulls in Debian’s default Python packages as part of its dependency set.As a result:
/usr/bin/python3points to Debian’s Python (3.13)/usr/local/bin/python3points to the requested Python (3.14)Expected Behavior
Ideally, the image would:
This would reduce ambiguity and make the runtime behavior more predictable, especially for build tools, virtual environments, and scripts that assume a single
python3.Reference
Dockerfile in question:
https://github.com/docker-library/python/blob/master/3.14/trixie/Dockerfile
Questions / Discussion Points
debian:trixieas the base image for the non-slim variant as well (similar to how theslimimages are built), instead ofbuildpack-deps?python3/python3.13packages in the Dockerfile after the build dependencies are installed?python:*-trixieconsidered expected and stable behavior going forward?I understand that
buildpack-depsis intentionally “heavy” and optimized for build scenarios, but the resulting multiple Python installations are somewhat surprising from a runtime image consumer’s perspective.Happy to provide a minimal reproducer or test case if that helps.
Thanks for maintaining the official Python images 🙏