Skip to content

Instantly share code, notes, and snippets.

@turicas
Last active December 1, 2025 05:28
Show Gist options
  • Select an option

  • Save turicas/aabe80601a69287766cb8a4307e0910e to your computer and use it in GitHub Desktop.

Select an option

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, Ubuntu, Fedora, AlmaLinux and Alpine Linux 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 13 trixie 2025-09-09 2028-08-09 Python 3.13.5
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
Debian GNU/Linux 9 stretch 2017-06-17 2020-07-18 Python 3.5.3
Debian GNU/Linux 8 jessie 2015-04-25 2018-06-17 Python 3.4.2
Ubuntu 25.10 questing 2025-10-09 2026-07-01 Python 3.13.7
Ubuntu 25.04 plucky 2025-04-17 2026-01-01 Python 3.13.3
Ubuntu 24.10 oracular 2024-10-10 2025-07-01 Python 3.12.7
Ubuntu 24.04 noble 2024-04-25 2029-04-01 Python 3.12.3
Ubuntu 23.10 mantic 2023-10-12 2024-07-11 Python 3.11.6
Ubuntu 23.04 lunar 2023-04-20 2024-01-25 Python 3.11.4
Ubuntu 22.10 kinetic 2022-10-20 2023-07-20 Python 3.10.7
Ubuntu 22.04 jammy 2022-04-21 2024-04-01 Python 3.10.12
Ubuntu 21.10 impish 2021-10-14 2022-04-14 Python 3.9.7
Ubuntu 21.04 hirsute 2021-04-22 2022-01-20 Python 3.9.5
Ubuntu 20.10 groovy 2020-10-22 2021-07-22 Python 3.8.10
Ubuntu 20.04 focal 2020-04-23 2025-04-01 Python 3.8.10
Ubuntu 19.10 eoan 2019-10-17 2020-07-17 Python 3.7.5
Ubuntu 19.04 disco 2019-04-18 2020-01-23 Python 3.7.3
Ubuntu 18.10 cosmic 2018-10-18 2019-07-18 Python 3.6.8
Ubuntu 18.04 bionic 2018-04-26 2023-04-01 Python 3.6.9
Ubuntu 17.10 artful 2017-10-19 2018-07-19 Python 3.6.3
Ubuntu 17.04 zesty 2017-04-13 2018-01-13 Python 3.5.3
Ubuntu 16.10 yakkety 2016-10-13 2017-07-20 Python 3.5.2+
Ubuntu 16.04 xenial 2016-04-21 2021-04-01 Python 3.5.2
Ubuntu 15.10 wily 2015-10-22 2016-07-28 Python 3.4.3+
Ubuntu 14.04 trusty 2014-04-17 2019-04-01 Python 3.4.3
Fedora Linux 43 - 2025-10-28 2026-12-09 Python 3.14.0
Fedora Linux 42 adams 2025-04-15 2026-05-13 Python 3.13.9
Fedora Linux 41 - 2024-10-29 2025-11-26 Python 3.13.9
Fedora Linux 40 - 2024-04-23 2025-05-13 Python 3.12.10
Fedora Linux 39 - 2023-11-07 2024-11-26 Python 3.12.7
Fedora Linux 38 - 2023-04-18 2024-05-21 Python 3.11.9
Fedora Linux 37 - 2022-11-15 2023-12-05 Python 3.11.6
Fedora Linux 36 - 2022-05-10 2023-05-16 Python 3.10.11
Fedora Linux 35 - 2021-11-02 2022-12-13 Python 3.10.8
Fedora 34 - 2021-04-27 2022-06-07 Python 3.9.13
Fedora 33 - 2020-10-27 2021-11-30 Python 3.9.9
Fedora 32 - 2020-04-28 2021-05-25 Python 3.8.10
Fedora 31 - 2019-10-29 2020-11-24 Python 3.7.9
Fedora 30 - 2019-04-30 2020-05-26 Python 3.7.7
Fedora 29 - 2018-10-30 2019-11-26 Python 3.7.5
Fedora 28 - 2018-05-01 2019-05-28 Python 3.6.8
Fedora 27 - 2017-11-14 2018-11-30 Python 3.6.6
Fedora 26 - 2017-07-11 2018-05-29 Python 3.6.5
Fedora 25 - 2016-11-22 2017-12-12 Python 3.5.4
Fedora 24 - 2016-06-21 2017-08-08 Python 3.5.3
Fedora 23 - 2015-11-03 2016-12-20 Python 3.4.3
Fedora 22 - 2015-05-26 2016-07-19 Python 3.4.2
AlmaLinux Kitten 10 - 2024-10-22 ? Python 3.12.11
AlmaLinux 10.1 - 2025-11-24 2030-05-31 Python 3.12.11
AlmaLinux 9.7 - 2025-11-17 2027-05-31 Python 3.9.23
AlmaLinux 8.10 - 2024-05-28 2024-05-31 Python 3.6.8
Alpine Linux 3.22.2 - 2025-05-30 2027-05-01 Python 3.12.12
Alpine Linux 3.21.5 - 2024-12-05 2026-11-01 Python 3.12.12
Alpine Linux 3.20.8 - 2024-05-22 2026-04-01 Python 3.12.12
Alpine Linux 3.19.9 - 2023-12-07 2025-11-01 Python 3.11.14
Alpine Linux 3.18.12 - 2023-05-09 2025-05-09 Python 3.11.12
Alpine Linux 3.17.10 - 2022-11-22 2024-11-22 Python 3.10.15
Alpine Linux 3.16.9 - 2022-05-23 2024-05-23 Python 3.10.14
Alpine Linux 3.15.11 - 2021-11-24 2023-11-01 Python 3.9.18
Alpine Linux 3.14.10 - 2021-06-15 2023-05-01 Python 3.9.17
Alpine Linux 3.13.12 - 2021-01-14 2022-11-01 Python 3.8.15
Alpine Linux 3.12.12 - 2020-05-29 2022-05-01 Python 3.8.10
Alpine Linux 3.11.13 - 2019-12-29 2021-11-01 Python 3.8.10
Alpine Linux 3.10.9 - 2019-06-19 2021-05-01 Python 3.7.10
Alpine Linux 3.9.6 - 2019-01-29 2020-11-01 Python 3.6.9
Alpine Linux 3.8.5 - 2018-06-26 2020-05-01 Python 3.6.9
Alpine Linux 3.7.3 - 2017-11-30 2019-11-01 Python 3.6.9
Alpine Linux 3.6.5 - 2017-05-24 2019-05-01 Python 3.6.8
Alpine Linux 3.5.3 - 2016-12-22 2018-11-01 Python 3.5.6
Alpine Linux 3.4.6 - 2016-05-31 2018-05-01 Python 3.5.2
Alpine Linux 3.3.3 - 2015-12-18 2017-11-01 Python 3.5.1
Alpine Linux 3.2.3 - 2015-05-26 2017-05-01 Python 3.4.3

¹: for Ubuntu current releases (LTS and the last two), this column represents the end of standard support, not the end of life; for AlmaLinux, this column represents the end of active support (not the end of security support).

#!/bin/bash
cat <<'EOF'> check-python-version-apt.sh
#!/bin/bash
# Old versions - use archive repositories
if [[ $(cat /etc/lsb-release | grep -i ubuntu | wc -l) -gt 0 ]]; then
# Ubuntu image
source /etc/lsb-release
lts=("24.04" "22.04" "20.04" "18.04" "16.04" "14.04")
if [[ $DISTRIB_RELEASE =~ (1[0-9]|2[0123])\. ]] && [[ ! " ${lts[*]} " =~ " $DISTRIB_RELEASE " ]]; then
echo "Changing sources.list to old-releases.ubuntu.com"
sed -Ei 's/(archive|security)\.ubuntu\.com\/ubuntu/old-releases.ubuntu.com\/ubuntu/g' /etc/apt/sources.list
fi
else
# Debian image
debian_version=$(cat /etc/debian_version)
echo "Debian version: ${debian_version}"
if [[ $debian_version =~ ([0-9]+)\. ]]; then
echo "Changing sources.list to archive.debian.org"
sed -Ei 's/(deb|security).debian.org/archive.debian.org/g; s/^deb /deb [trusted=yes] /; /-updates/d' /etc/apt/sources.list
fi
fi
apt update
apt install -y python3
source /etc/os-release
echo "${NAME} | ${VERSION_ID} | ${VERSION_CODENAME} | $(python3 --version)"
EOF
cat <<'EOF'> check-python-version-dnf.sh
#!/bin/bash
dnf update -y
dnf install -y python3
source /etc/os-release
echo "${NAME} | ${VERSION_ID} | ${VERSION_CODENAME} | $(python3 --version)"
EOF
cat <<'EOF'> check-python-version-apk.sh
#!/bin/sh
apk update
apk upgrade
apk add python3
source /etc/os-release
echo "${NAME} | ${VERSION_ID} | ${VERSION_CODENAME} | $(python3 --version)"
EOF
# Debian
for version in trixie bookworm bullseye buster stretch jessie; do
image="debian:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version-apt.sh:/check-python-version.sh \
--rm \
"$image" \
bash -c 'chmod +x /check-python-version.sh && /check-python-version.sh'
done
for version in 25.10 25.04 24.10 24.04 23.10 23.04 22.10 22.04 21.10 21.04 20.10 20.04 19.10 19.04 18.10 18.04 17.10 17.04 16.10 16.04 15.10 14.04; do
image="ubuntu:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version-apt.sh:/check-python-version.sh \
--rm \
"$image" \
bash -c 'chmod +x /check-python-version.sh && /check-python-version.sh'
done
for version in 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22; do
image="fedora:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version-dnf.sh:/check-python-version.sh \
--rm \
"$image" \
bash -c 'chmod +x /check-python-version.sh && /check-python-version.sh'
done
for version in 10-kitten 10.1 9.7 8.10; do
image="almalinux:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version-dnf.sh:/check-python-version.sh \
--rm \
"$image" \
bash -c 'chmod +x /check-python-version.sh && /check-python-version.sh'
done
for version in 3.22 3.21 3.20 3.19 3.18 3.17 3.16 3.15 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2; do
image="alpine:${version}"
echo "-----> $image"
docker run \
-v $(pwd)/check-python-version-apk.sh:/check-python-version.sh \
--rm \
"$image" \
/bin/sh -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