Skip to content

Instantly share code, notes, and snippets.

@turicas
Created January 23, 2025 17:06
Show Gist options
  • Save turicas/aabe80601a69287766cb8a4307e0910e to your computer and use it in GitHub Desktop.
Save turicas/aabe80601a69287766cb8a4307e0910e to your computer and use it in GitHub Desktop.
Python versions in Debian and Ubuntu official Docker images

Python versions in Debian and Ubuntu official Docker images

The table below was made by installing the package python3 in each Docker image and then running python --version (see the python-versions.sh for more details). Release and end of life dates were taken from:

Distribution Version Codename Released at End of Life Python version
Debian GNU/Linux 12 bookworm 2023-06-10 2026-06-10 Python 3.11.2
Debian GNU/Linux 11 bullseye 2021-08-14 2024-08-14 Python 3.9.2
Debian GNU/Linux 10 buster 2019-07-06 2022-09-10 Python 3.7.3
Ubuntu 24.10 oracular 2024-10-01 2025-07-01 Python 3.12.7
Ubuntu 24.04 noble 2024-04-01 2029-04-01 Python 3.12.3
Ubuntu 22.04 jammy 2022-04-01 2024-04-01 Python 3.10.12
Ubuntu 20.04 focal 2020-04-01 2025-04-01 Python 3.8.10
Ubuntu 18.04 bionic 2020-04-01 2023-04-01 Python 3.6.9
#!/bin/bash
cat <<'EOF'> check-python-version.sh
#!/bin/bash
apt update
apt install -y python3
source /etc/os-release
echo "${NAME} | ${VERSION_ID} | ${VERSION_CODENAME} | $(python3 --version)"
EOF
# Debian
# I had problems executing this in stretch and jessie, so skipped
for version in bookworm bullseye buster; do
image="debian:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version.sh:/check-python-version.sh \
--rm \
"$image" \
bash -c 'chmod +x /check-python-version.sh && /check-python-version.sh'
done
# By the time I made this script, only the LTS versions were available in APT
for version in 25.04 24.10 24.04 23.10 22.04 20.04 18.04; do
image="ubuntu:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version.sh:/check-python-version.sh \
--rm \
"$image" \
bash -c 'chmod +x /check-python-version.sh && /check-python-version.sh'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment