diff --git a/3.10/alpine3.23/Dockerfile b/3.10/alpine3.23/Dockerfile deleted file mode 100644 index 79b0e3ec2..000000000 --- a/3.10/alpine3.23/Dockerfile +++ /dev/null @@ -1,140 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.23 - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apk add --no-cache \ - ca-certificates \ - tzdata \ - ; - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.20 -ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - gnupg \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tar \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - xz \ - xz-dev \ - zlib-dev \ - ; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ - wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \ - gpg --batch --verify python.tar.xz.asc python.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" python.tar.xz.asc; \ - mkdir -p /usr/src/python; \ - tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ - rm python.tar.xz; \ - \ - cd /usr/src/python; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --enable-loadable-sqlite-extensions \ - --enable-option-checking=fatal \ - --enable-shared \ - $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ -# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() -# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 - EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - ; \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - rm python; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ - python \ - ; \ - make install; \ - \ - cd /; \ - rm -rf /usr/src/python; \ - \ - find /usr/local -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - | xargs -rt apk add --no-network --virtual .python-rundeps \ - ; \ - apk del --no-network .build-deps; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ - ; \ - pip3 --version - -# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) -RUN set -eux; \ - for src in idle3 pip3 pydoc3 python3 python3-config; do \ - dst="$(echo "$src" | tr -d 3)"; \ - [ -s "/usr/local/bin/$src" ]; \ - [ ! -e "/usr/local/bin/$dst" ]; \ - ln -svT "$src" "/usr/local/bin/$dst"; \ - done - -CMD ["python3"] diff --git a/3.10/bookworm/Dockerfile b/3.10/bookworm/Dockerfile deleted file mode 100644 index 63792f437..000000000 --- a/3.10/bookworm/Dockerfile +++ /dev/null @@ -1,113 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bookworm - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libbluetooth-dev \ - tk-dev \ - uuid-dev \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.20 -ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 - -RUN set -eux; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ - wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \ - gpg --batch --verify python.tar.xz.asc python.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" python.tar.xz.asc; \ - mkdir -p /usr/src/python; \ - tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ - rm python.tar.xz; \ - \ - cd /usr/src/python; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - ; \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - rm python; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ - python \ - ; \ - make install; \ - \ -# enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 - bin="$(readlink -ve /usr/local/bin/python3)"; \ - dir="$(dirname "$bin")"; \ - mkdir -p "/usr/share/gdb/auto-load/$dir"; \ - cp -vL Tools/gdb/libpython.py "/usr/share/gdb/auto-load/$bin-gdb.py"; \ - \ - cd /; \ - rm -rf /usr/src/python; \ - \ - find /usr/local -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ - ; \ - pip3 --version - -# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) -RUN set -eux; \ - for src in idle3 pip3 pydoc3 python3 python3-config; do \ - dst="$(echo "$src" | tr -d 3)"; \ - [ -s "/usr/local/bin/$src" ]; \ - [ ! -e "/usr/local/bin/$dst" ]; \ - ln -svT "$src" "/usr/local/bin/$dst"; \ - done - -CMD ["python3"] diff --git a/3.10/slim-bookworm/Dockerfile b/3.10/slim-bookworm/Dockerfile deleted file mode 100644 index bd2968c14..000000000 --- a/3.10/slim-bookworm/Dockerfile +++ /dev/null @@ -1,147 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:bookworm-slim - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - netbase \ - tzdata \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.20 -ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - dpkg-dev \ - gcc \ - gnupg \ - libbluetooth-dev \ - libbz2-dev \ - libc6-dev \ - libdb-dev \ - libffi-dev \ - libgdbm-dev \ - liblzma-dev \ - libncursesw5-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tk-dev \ - uuid-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ - wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \ - gpg --batch --verify python.tar.xz.asc python.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" python.tar.xz.asc; \ - mkdir -p /usr/src/python; \ - tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ - rm python.tar.xz; \ - \ - cd /usr/src/python; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - ; \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - rm python; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ - python \ - ; \ - make install; \ - \ - cd /; \ - rm -rf /usr/src/python; \ - \ - find /usr/local -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -rt dpkg-query --search \ -# https://manpages.debian.org/bookworm/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) - | awk 'sub(":$", "", $1) { print $1 }' \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ - ; \ - pip3 --version - -# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) -RUN set -eux; \ - for src in idle3 pip3 pydoc3 python3 python3-config; do \ - dst="$(echo "$src" | tr -d 3)"; \ - [ -s "/usr/local/bin/$src" ]; \ - [ ! -e "/usr/local/bin/$dst" ]; \ - ln -svT "$src" "/usr/local/bin/$dst"; \ - done - -CMD ["python3"] diff --git a/3.10/slim-trixie/Dockerfile b/3.10/slim-trixie/Dockerfile deleted file mode 100644 index f4c7fbb07..000000000 --- a/3.10/slim-trixie/Dockerfile +++ /dev/null @@ -1,147 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:trixie-slim - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - netbase \ - tzdata \ - ; \ - apt-get dist-clean - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.20 -ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - dpkg-dev \ - gcc \ - gnupg \ - libbluetooth-dev \ - libbz2-dev \ - libc6-dev \ - libdb-dev \ - libffi-dev \ - libgdbm-dev \ - liblzma-dev \ - libncursesw5-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tk-dev \ - uuid-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ - wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \ - gpg --batch --verify python.tar.xz.asc python.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" python.tar.xz.asc; \ - mkdir -p /usr/src/python; \ - tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ - rm python.tar.xz; \ - \ - cd /usr/src/python; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - ; \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - rm python; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ - python \ - ; \ - make install; \ - \ - cd /; \ - rm -rf /usr/src/python; \ - \ - find /usr/local -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -rt dpkg-query --search \ -# https://manpages.debian.org/bookworm/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) - | awk 'sub(":$", "", $1) { print $1 }' \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - apt-get dist-clean; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ - ; \ - pip3 --version - -# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) -RUN set -eux; \ - for src in idle3 pip3 pydoc3 python3 python3-config; do \ - dst="$(echo "$src" | tr -d 3)"; \ - [ -s "/usr/local/bin/$src" ]; \ - [ ! -e "/usr/local/bin/$dst" ]; \ - ln -svT "$src" "/usr/local/bin/$dst"; \ - done - -CMD ["python3"] diff --git a/3.10/trixie/Dockerfile b/3.10/trixie/Dockerfile deleted file mode 100644 index edb9616d9..000000000 --- a/3.10/trixie/Dockerfile +++ /dev/null @@ -1,113 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:trixie - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libbluetooth-dev \ - tk-dev \ - uuid-dev \ - ; \ - apt-get dist-clean - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.20 -ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 - -RUN set -eux; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ - wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \ - gpg --batch --verify python.tar.xz.asc python.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" python.tar.xz.asc; \ - mkdir -p /usr/src/python; \ - tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ - rm python.tar.xz; \ - \ - cd /usr/src/python; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - ; \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - rm python; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ - python \ - ; \ - make install; \ - \ -# enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 - bin="$(readlink -ve /usr/local/bin/python3)"; \ - dir="$(dirname "$bin")"; \ - mkdir -p "/usr/share/gdb/auto-load/$dir"; \ - cp -vL Tools/gdb/libpython.py "/usr/share/gdb/auto-load/$bin-gdb.py"; \ - \ - cd /; \ - rm -rf /usr/src/python; \ - \ - find /usr/local -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ - ; \ - pip3 --version - -# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) -RUN set -eux; \ - for src in idle3 pip3 pydoc3 python3 python3-config; do \ - dst="$(echo "$src" | tr -d 3)"; \ - [ -s "/usr/local/bin/$src" ]; \ - [ ! -e "/usr/local/bin/$dst" ]; \ - ln -svT "$src" "/usr/local/bin/$dst"; \ - done - -CMD ["python3"] diff --git a/3.11/alpine3.22/Dockerfile b/3.11/alpine3.22/Dockerfile deleted file mode 100644 index d43ba24b8..000000000 --- a/3.11/alpine3.22/Dockerfile +++ /dev/null @@ -1,140 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.22 - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apk add --no-cache \ - ca-certificates \ - tzdata \ - ; - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.15 -ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - gnupg \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tar \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - xz \ - xz-dev \ - zlib-dev \ - ; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ - wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \ - gpg --batch --verify python.tar.xz.asc python.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" python.tar.xz.asc; \ - mkdir -p /usr/src/python; \ - tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ - rm python.tar.xz; \ - \ - cd /usr/src/python; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --enable-loadable-sqlite-extensions \ - --enable-option-checking=fatal \ - --enable-shared \ - $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ -# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() -# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 - EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ - LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - ; \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - rm python; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ - python \ - ; \ - make install; \ - \ - cd /; \ - rm -rf /usr/src/python; \ - \ - find /usr/local -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - | xargs -rt apk add --no-network --virtual .python-rundeps \ - ; \ - apk del --no-network .build-deps; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ - ; \ - pip3 --version - -# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) -RUN set -eux; \ - for src in idle3 pip3 pydoc3 python3 python3-config; do \ - dst="$(echo "$src" | tr -d 3)"; \ - [ -s "/usr/local/bin/$src" ]; \ - [ ! -e "/usr/local/bin/$dst" ]; \ - ln -svT "$src" "/usr/local/bin/$dst"; \ - done - -CMD ["python3"] diff --git a/3.11/alpine3.23/Dockerfile b/3.11/alpine3.23/Dockerfile index 9a4d0c7ad..c52c0818c 100644 --- a/3.11/alpine3.23/Dockerfile +++ b/3.11/alpine3.23/Dockerfile @@ -10,8 +10,12 @@ FROM alpine:3.23 ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.11 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -22,8 +26,8 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.15 -ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 +ENV PYTHON_VERSION 3.11.18 +ENV PYTHON_SHA256 9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290 RUN set -eux; \ \ @@ -32,6 +36,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ @@ -123,8 +128,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ pip3 --version diff --git a/3.10/alpine3.22/Dockerfile b/3.11/alpine3.24/Dockerfile similarity index 83% rename from 3.10/alpine3.22/Dockerfile rename to 3.11/alpine3.24/Dockerfile index e3be8f98a..aae7b326c 100644 --- a/3.10/alpine3.22/Dockerfile +++ b/3.11/alpine3.24/Dockerfile @@ -4,14 +4,18 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.11 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -22,8 +26,8 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.20 -ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 +ENV PYTHON_VERSION 3.11.18 +ENV PYTHON_SHA256 9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290 RUN set -eux; \ \ @@ -32,6 +36,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ @@ -123,8 +128,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ pip3 --version diff --git a/3.11/bookworm/Dockerfile b/3.11/bookworm/Dockerfile index 2968b791e..20d9ed3c8 100644 --- a/3.11/bookworm/Dockerfile +++ b/3.11/bookworm/Dockerfile @@ -10,8 +10,12 @@ FROM buildpack-deps:bookworm ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.11 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.15 -ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 +ENV PYTHON_VERSION 3.11.18 +ENV PYTHON_SHA256 9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290 RUN set -eux; \ \ @@ -96,8 +100,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ pip3 --version diff --git a/3.11/slim-bookworm/Dockerfile b/3.11/slim-bookworm/Dockerfile index db4b9d00b..14f53f16b 100644 --- a/3.11/slim-bookworm/Dockerfile +++ b/3.11/slim-bookworm/Dockerfile @@ -10,8 +10,12 @@ FROM debian:bookworm-slim ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.11 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.15 -ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 +ENV PYTHON_VERSION 3.11.18 +ENV PYTHON_SHA256 9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290 RUN set -eux; \ \ @@ -34,6 +38,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ @@ -130,8 +135,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ pip3 --version diff --git a/3.11/slim-trixie/Dockerfile b/3.11/slim-trixie/Dockerfile index 2a24cfdf4..ea4885ed9 100644 --- a/3.11/slim-trixie/Dockerfile +++ b/3.11/slim-trixie/Dockerfile @@ -10,8 +10,12 @@ FROM debian:trixie-slim ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.11 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ apt-get dist-clean ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.15 -ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 +ENV PYTHON_VERSION 3.11.18 +ENV PYTHON_SHA256 9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290 RUN set -eux; \ \ @@ -34,6 +38,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ @@ -130,8 +135,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ pip3 --version diff --git a/3.11/trixie/Dockerfile b/3.11/trixie/Dockerfile index efd749b62..e39736406 100644 --- a/3.11/trixie/Dockerfile +++ b/3.11/trixie/Dockerfile @@ -10,8 +10,12 @@ FROM buildpack-deps:trixie ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.11 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ apt-get dist-clean ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.15 -ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 +ENV PYTHON_VERSION 3.11.18 +ENV PYTHON_SHA256 9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290 RUN set -eux; \ \ @@ -96,8 +100,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ 'setuptools==79.0.1' \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ pip3 --version diff --git a/3.12/alpine3.23/Dockerfile b/3.12/alpine3.23/Dockerfile index 91342ac4d..2814640cb 100644 --- a/3.12/alpine3.23/Dockerfile +++ b/3.12/alpine3.23/Dockerfile @@ -10,8 +10,12 @@ FROM alpine:3.23 ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.12 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -22,8 +26,8 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.13 -ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 +ENV PYTHON_VERSION 3.12.16 +ENV PYTHON_SHA256 b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c RUN set -eux; \ \ @@ -32,6 +36,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ diff --git a/3.12/alpine3.22/Dockerfile b/3.12/alpine3.24/Dockerfile similarity index 85% rename from 3.12/alpine3.22/Dockerfile rename to 3.12/alpine3.24/Dockerfile index 37c814fee..7133ae8ff 100644 --- a/3.12/alpine3.22/Dockerfile +++ b/3.12/alpine3.24/Dockerfile @@ -4,14 +4,18 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.12 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -22,8 +26,8 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.13 -ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 +ENV PYTHON_VERSION 3.12.16 +ENV PYTHON_SHA256 b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c RUN set -eux; \ \ @@ -32,6 +36,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ diff --git a/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile index e84b5f8af..e3e687f55 100644 --- a/3.12/bookworm/Dockerfile +++ b/3.12/bookworm/Dockerfile @@ -10,8 +10,12 @@ FROM buildpack-deps:bookworm ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.12 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.13 -ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 +ENV PYTHON_VERSION 3.12.16 +ENV PYTHON_SHA256 b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c RUN set -eux; \ \ diff --git a/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile index 7039a72d5..70d148608 100644 --- a/3.12/slim-bookworm/Dockerfile +++ b/3.12/slim-bookworm/Dockerfile @@ -10,8 +10,12 @@ FROM debian:bookworm-slim ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.12 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.13 -ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 +ENV PYTHON_VERSION 3.12.16 +ENV PYTHON_SHA256 b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c RUN set -eux; \ \ @@ -34,6 +38,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ diff --git a/3.12/slim-trixie/Dockerfile b/3.12/slim-trixie/Dockerfile index e9c8ec000..76678dcf4 100644 --- a/3.12/slim-trixie/Dockerfile +++ b/3.12/slim-trixie/Dockerfile @@ -10,8 +10,12 @@ FROM debian:trixie-slim ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.12 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.13 -ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 +ENV PYTHON_VERSION 3.12.16 +ENV PYTHON_SHA256 b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c RUN set -eux; \ \ @@ -34,6 +38,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ diff --git a/3.12/trixie/Dockerfile b/3.12/trixie/Dockerfile index 683a96eb4..e175d309e 100644 --- a/3.12/trixie/Dockerfile +++ b/3.12/trixie/Dockerfile @@ -10,8 +10,12 @@ FROM buildpack-deps:trixie ENV PATH /usr/local/bin:$PATH # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.12 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 # runtime dependencies @@ -25,8 +29,8 @@ RUN set -eux; \ apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.13 -ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 +ENV PYTHON_VERSION 3.12.16 +ENV PYTHON_SHA256 b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c RUN set -eux; \ \ diff --git a/3.13/alpine3.23/Dockerfile b/3.13/alpine3.23/Dockerfile index 6505bf3e7..ff6245df8 100644 --- a/3.13/alpine3.23/Dockerfile +++ b/3.13/alpine3.23/Dockerfile @@ -9,6 +9,15 @@ FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.13 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apk add --no-cache \ @@ -17,8 +26,8 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71 +ENV PYTHON_VERSION 3.13.18 +ENV PYTHON_SHA256 abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68 RUN set -eux; \ \ @@ -27,6 +36,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ diff --git a/3.13/alpine3.22/Dockerfile b/3.13/alpine3.24/Dockerfile similarity index 81% rename from 3.13/alpine3.22/Dockerfile rename to 3.13/alpine3.24/Dockerfile index 886d59a79..2048492f4 100644 --- a/3.13/alpine3.22/Dockerfile +++ b/3.13/alpine3.24/Dockerfile @@ -4,11 +4,20 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.13 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apk add --no-cache \ @@ -17,8 +26,8 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71 +ENV PYTHON_VERSION 3.13.18 +ENV PYTHON_SHA256 abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68 RUN set -eux; \ \ @@ -27,6 +36,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ diff --git a/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile index 7f51c6722..645eb954e 100644 --- a/3.13/bookworm/Dockerfile +++ b/3.13/bookworm/Dockerfile @@ -9,6 +9,15 @@ FROM buildpack-deps:bookworm # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.13 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -20,8 +29,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71 +ENV PYTHON_VERSION 3.13.18 +ENV PYTHON_SHA256 abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68 RUN set -eux; \ \ diff --git a/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile index f3b5851c9..731ba320c 100644 --- a/3.13/slim-bookworm/Dockerfile +++ b/3.13/slim-bookworm/Dockerfile @@ -9,6 +9,15 @@ FROM debian:bookworm-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.13 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -20,8 +29,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71 +ENV PYTHON_VERSION 3.13.18 +ENV PYTHON_SHA256 abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68 RUN set -eux; \ \ @@ -29,6 +38,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ diff --git a/3.13/slim-trixie/Dockerfile b/3.13/slim-trixie/Dockerfile index fc559c904..5b154dd68 100644 --- a/3.13/slim-trixie/Dockerfile +++ b/3.13/slim-trixie/Dockerfile @@ -9,6 +9,15 @@ FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.13 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -20,8 +29,8 @@ RUN set -eux; \ apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71 +ENV PYTHON_VERSION 3.13.18 +ENV PYTHON_SHA256 abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68 RUN set -eux; \ \ @@ -29,6 +38,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ diff --git a/3.13/trixie/Dockerfile b/3.13/trixie/Dockerfile index ea7235eb8..7988eeeb6 100644 --- a/3.13/trixie/Dockerfile +++ b/3.13/trixie/Dockerfile @@ -9,6 +9,15 @@ FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.13 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -20,8 +29,8 @@ RUN set -eux; \ apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71 +ENV PYTHON_VERSION 3.13.18 +ENV PYTHON_SHA256 abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68 RUN set -eux; \ \ diff --git a/3.14/alpine3.23/Dockerfile b/3.14/alpine3.23/Dockerfile index b85b88aeb..e61655889 100644 --- a/3.14/alpine3.23/Dockerfile +++ b/3.14/alpine3.23/Dockerfile @@ -9,6 +9,15 @@ FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.14 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apk add --no-cache \ @@ -16,8 +25,8 @@ RUN set -eux; \ tzdata \ ; -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6 +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032 RUN set -eux; \ \ @@ -26,6 +35,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ diff --git a/3.14/alpine3.22/Dockerfile b/3.14/alpine3.24/Dockerfile similarity index 80% rename from 3.14/alpine3.22/Dockerfile rename to 3.14/alpine3.24/Dockerfile index 2d3671809..ea0da422c 100644 --- a/3.14/alpine3.22/Dockerfile +++ b/3.14/alpine3.24/Dockerfile @@ -4,11 +4,20 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.14 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apk add --no-cache \ @@ -16,8 +25,8 @@ RUN set -eux; \ tzdata \ ; -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6 +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032 RUN set -eux; \ \ @@ -26,6 +35,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ diff --git a/3.14/bookworm/Dockerfile b/3.14/bookworm/Dockerfile index ce5caff27..2f2cbec67 100644 --- a/3.14/bookworm/Dockerfile +++ b/3.14/bookworm/Dockerfile @@ -9,6 +9,15 @@ FROM buildpack-deps:bookworm # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.14 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6 +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032 RUN set -eux; \ \ diff --git a/3.14/slim-bookworm/Dockerfile b/3.14/slim-bookworm/Dockerfile index f0f3b8f86..e5731735b 100644 --- a/3.14/slim-bookworm/Dockerfile +++ b/3.14/slim-bookworm/Dockerfile @@ -9,6 +9,15 @@ FROM debian:bookworm-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.14 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6 +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032 RUN set -eux; \ \ @@ -28,6 +37,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ diff --git a/3.14/slim-trixie/Dockerfile b/3.14/slim-trixie/Dockerfile index f0df9e6fd..3e936ce3e 100644 --- a/3.14/slim-trixie/Dockerfile +++ b/3.14/slim-trixie/Dockerfile @@ -9,6 +9,15 @@ FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.14 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ apt-get dist-clean -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6 +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032 RUN set -eux; \ \ @@ -28,6 +37,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ diff --git a/3.14/trixie/Dockerfile b/3.14/trixie/Dockerfile index 0b8ebb4e0..5e2f637eb 100644 --- a/3.14/trixie/Dockerfile +++ b/3.14/trixie/Dockerfile @@ -9,6 +9,15 @@ FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.14 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ apt-get dist-clean -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6 +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032 RUN set -eux; \ \ diff --git a/3.14/windows/windowsservercore-ltsc2022/Dockerfile b/3.14/windows/windowsservercore-ltsc2022/Dockerfile index 739eac5c3..9dd505c85 100644 --- a/3.14/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.14/windows/windowsservercore-ltsc2022/Dockerfile @@ -11,10 +11,10 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 f9c09f5ed6f796fd1a8bc5ddfa41715a494b453c4781f0e35d5077cf9fa58f6d +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 92480239264744fe0386a1bd8275786fefa126e3129e56a68e22b52c73329965 -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ +RUN $url = 'https://www.python.org/ftp/python/3.14.10/python-3.14.10-amd64.exe'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ @@ -48,13 +48,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en # the installer updated PATH, so we should refresh our local value $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ + \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ Write-Host 'Verifying pip install ...'; \ diff --git a/3.14/windows/windowsservercore-ltsc2025/Dockerfile b/3.14/windows/windowsservercore-ltsc2025/Dockerfile index 00143dfc5..1fb260e94 100644 --- a/3.14/windows/windowsservercore-ltsc2025/Dockerfile +++ b/3.14/windows/windowsservercore-ltsc2025/Dockerfile @@ -11,10 +11,10 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.14.5 -ENV PYTHON_SHA256 f9c09f5ed6f796fd1a8bc5ddfa41715a494b453c4781f0e35d5077cf9fa58f6d +ENV PYTHON_VERSION 3.14.10 +ENV PYTHON_SHA256 92480239264744fe0386a1bd8275786fefa126e3129e56a68e22b52c73329965 -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ +RUN $url = 'https://www.python.org/ftp/python/3.14.10/python-3.14.10-amd64.exe'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ @@ -48,13 +48,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en # the installer updated PATH, so we should refresh our local value $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ + \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ Write-Host 'Verifying pip install ...'; \ diff --git a/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile b/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile deleted file mode 100644 index 492b71f45..000000000 --- a/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM mcr.microsoft.com/windows/servercore:ltsc2022 - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -# https://github.com/docker-library/python/pull/557 -ENV PYTHONIOENCODING UTF-8 - -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 f73038ee13ab1b131e6b2082a0f5c94e2a6d0aa834c452f2e1cefb90eba92c89 - -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ - if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ -# https://docs.python.org/3/using/windows.html#installing-without-ui - $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ - -ArgumentList @( \ - '/quiet', \ - 'InstallAllUsers=1', \ - 'TargetDir=C:\Python', \ - 'PrependPath=1', \ - 'Shortcuts=0', \ - 'Include_doc=0', \ - 'Include_pip=1', \ - 'Include_test=0' \ - ) \ - ).ExitCode; \ - if ($exitCode -ne 0) { \ - Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ - Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ - exit $exitCode; \ - } \ - \ -# the installer updated PATH, so we should refresh our local value - $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item python.exe -Force; \ - Remove-Item $env:TEMP/Python*.log -Force; \ - \ - $env:PYTHONDONTWRITEBYTECODE = '1'; \ - \ - Write-Host 'Verifying pip install ...'; \ - pip --version; \ - \ - Write-Host 'Complete.' - -CMD ["python"] diff --git a/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile b/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile deleted file mode 100644 index 2bfd48fcd..000000000 --- a/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM mcr.microsoft.com/windows/servercore:ltsc2025 - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -# https://github.com/docker-library/python/pull/557 -ENV PYTHONIOENCODING UTF-8 - -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 f73038ee13ab1b131e6b2082a0f5c94e2a6d0aa834c452f2e1cefb90eba92c89 - -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ - if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ -# https://docs.python.org/3/using/windows.html#installing-without-ui - $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ - -ArgumentList @( \ - '/quiet', \ - 'InstallAllUsers=1', \ - 'TargetDir=C:\Python', \ - 'PrependPath=1', \ - 'Shortcuts=0', \ - 'Include_doc=0', \ - 'Include_pip=1', \ - 'Include_test=0' \ - ) \ - ).ExitCode; \ - if ($exitCode -ne 0) { \ - Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ - Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ - exit $exitCode; \ - } \ - \ -# the installer updated PATH, so we should refresh our local value - $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item python.exe -Force; \ - Remove-Item $env:TEMP/Python*.log -Force; \ - \ - $env:PYTHONDONTWRITEBYTECODE = '1'; \ - \ - Write-Host 'Verifying pip install ...'; \ - pip --version; \ - \ - Write-Host 'Complete.' - -CMD ["python"] diff --git a/3.15-rc/alpine3.23/Dockerfile b/3.15/alpine3.23/Dockerfile similarity index 80% rename from 3.15-rc/alpine3.23/Dockerfile rename to 3.15/alpine3.23/Dockerfile index 9ce29ec77..51a28a91d 100644 --- a/3.15-rc/alpine3.23/Dockerfile +++ b/3.15/alpine3.23/Dockerfile @@ -9,6 +9,15 @@ FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.15 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apk add --no-cache \ @@ -16,8 +25,8 @@ RUN set -eux; \ tzdata \ ; -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de RUN set -eux; \ \ @@ -26,6 +35,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ @@ -35,6 +45,7 @@ RUN set -eux; \ libtirpc-dev \ linux-headers \ make \ + mpdecimal-dev \ ncurses-dev \ openssl-dev \ pax-utils \ diff --git a/3.15-rc/alpine3.22/Dockerfile b/3.15/alpine3.24/Dockerfile similarity index 79% rename from 3.15-rc/alpine3.22/Dockerfile rename to 3.15/alpine3.24/Dockerfile index 6dcf70638..c28e71b43 100644 --- a/3.15-rc/alpine3.22/Dockerfile +++ b/3.15/alpine3.24/Dockerfile @@ -4,11 +4,20 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.15 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apk add --no-cache \ @@ -16,8 +25,8 @@ RUN set -eux; \ tzdata \ ; -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de RUN set -eux; \ \ @@ -26,6 +35,7 @@ RUN set -eux; \ bzip2-dev \ dpkg-dev dpkg \ findutils \ + g++ \ gcc \ gdbm-dev \ gnupg \ @@ -35,6 +45,7 @@ RUN set -eux; \ libtirpc-dev \ linux-headers \ make \ + mpdecimal-dev \ ncurses-dev \ openssl-dev \ pax-utils \ diff --git a/3.15-rc/bookworm/Dockerfile b/3.15/bookworm/Dockerfile similarity index 80% rename from 3.15-rc/bookworm/Dockerfile rename to 3.15/bookworm/Dockerfile index cc87ddb04..f3c01cebd 100644 --- a/3.15-rc/bookworm/Dockerfile +++ b/3.15/bookworm/Dockerfile @@ -9,6 +9,15 @@ FROM buildpack-deps:bookworm # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.15 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de RUN set -eux; \ \ @@ -46,6 +55,8 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/pull/1137#issuecomment-6180817683 + --without-system-libmpdec \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.15-rc/slim-bookworm/Dockerfile b/3.15/slim-bookworm/Dockerfile similarity index 80% rename from 3.15-rc/slim-bookworm/Dockerfile rename to 3.15/slim-bookworm/Dockerfile index 7cd5e9c25..3777cb50a 100644 --- a/3.15-rc/slim-bookworm/Dockerfile +++ b/3.15/slim-bookworm/Dockerfile @@ -9,6 +9,15 @@ FROM debian:bookworm-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.15 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de RUN set -eux; \ \ @@ -28,6 +37,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ @@ -66,6 +76,8 @@ RUN set -eux; \ --enable-shared \ $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +# https://github.com/docker-library/python/pull/1137#issuecomment-6180817683 + --without-system-libmpdec \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ diff --git a/3.15-rc/slim-trixie/Dockerfile b/3.15/slim-trixie/Dockerfile similarity index 81% rename from 3.15-rc/slim-trixie/Dockerfile rename to 3.15/slim-trixie/Dockerfile index d5ebe0ef7..04ebf28d1 100644 --- a/3.15-rc/slim-trixie/Dockerfile +++ b/3.15/slim-trixie/Dockerfile @@ -9,6 +9,15 @@ FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.15 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,8 +28,8 @@ RUN set -eux; \ ; \ apt-get dist-clean -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de RUN set -eux; \ \ @@ -28,6 +37,7 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ dpkg-dev \ + g++ \ gcc \ gnupg \ libbluetooth-dev \ @@ -37,6 +47,7 @@ RUN set -eux; \ libffi-dev \ libgdbm-dev \ liblzma-dev \ + libmpdec-dev \ libncursesw5-dev \ libreadline-dev \ libsqlite3-dev \ diff --git a/3.15-rc/trixie/Dockerfile b/3.15/trixie/Dockerfile similarity index 81% rename from 3.15-rc/trixie/Dockerfile rename to 3.15/trixie/Dockerfile index 33599d5fa..4bbe53aee 100644 --- a/3.15-rc/trixie/Dockerfile +++ b/3.15/trixie/Dockerfile @@ -9,6 +9,15 @@ FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.15 sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + # runtime dependencies RUN set -eux; \ apt-get update; \ @@ -19,14 +28,15 @@ RUN set -eux; \ ; \ apt-get dist-clean -ENV PYTHON_VERSION 3.15.0b2 -ENV PYTHON_SHA256 d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends \ + libmpdec-dev \ libzstd-dev \ ; \ \ diff --git a/3.13/windows/windowsservercore-ltsc2022/Dockerfile b/3.15/windows/windowsservercore-ltsc2022/Dockerfile similarity index 83% rename from 3.13/windows/windowsservercore-ltsc2022/Dockerfile rename to 3.15/windows/windowsservercore-ltsc2022/Dockerfile index 2d1524df7..5793ff487 100644 --- a/3.13/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.15/windows/windowsservercore-ltsc2022/Dockerfile @@ -11,10 +11,10 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 3c9c81d80f91c002ced86d645422d81432c68c7d9b6b0e974768ca2e449a4d00 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 06e225a228191b0f4d1dcf6905fbb21bf9f6970d13a2ec63137ab9bee76f15aa -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ +RUN $url = 'https://www.python.org/ftp/python/3.15.2/python-3.15.2-amd64.exe'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ @@ -48,13 +48,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en # the installer updated PATH, so we should refresh our local value $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ + \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ Write-Host 'Verifying pip install ...'; \ diff --git a/3.13/windows/windowsservercore-ltsc2025/Dockerfile b/3.15/windows/windowsservercore-ltsc2025/Dockerfile similarity index 83% rename from 3.13/windows/windowsservercore-ltsc2025/Dockerfile rename to 3.15/windows/windowsservercore-ltsc2025/Dockerfile index 7ef5895fb..a03c84e62 100644 --- a/3.13/windows/windowsservercore-ltsc2025/Dockerfile +++ b/3.15/windows/windowsservercore-ltsc2025/Dockerfile @@ -11,10 +11,10 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.13.13 -ENV PYTHON_SHA256 3c9c81d80f91c002ced86d645422d81432c68c7d9b6b0e974768ca2e449a4d00 +ENV PYTHON_VERSION 3.15.2 +ENV PYTHON_SHA256 06e225a228191b0f4d1dcf6905fbb21bf9f6970d13a2ec63137ab9bee76f15aa -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ +RUN $url = 'https://www.python.org/ftp/python/3.15.2/python-3.15.2-amd64.exe'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ @@ -48,13 +48,13 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en # the installer updated PATH, so we should refresh our local value $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ + \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ Write-Host 'Verifying pip install ...'; \ diff --git a/3.16-rc/alpine3.23/Dockerfile b/3.16-rc/alpine3.23/Dockerfile new file mode 100644 index 000000000..6af0c95cb --- /dev/null +++ b/3.16-rc/alpine3.23/Dockerfile @@ -0,0 +1,149 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.23 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.16-rc sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.16.0a2 +ENV PYTHON_SHA256 5fb6a0b8b7a70af2ee1386edcfb832e9636a5331b2bf0376a06cac33c43aa0d0 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + g++ \ + gcc \ + gdbm-dev \ + gnupg \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + mpdecimal-dev \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tar \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz \ + xz-dev \ + zlib-dev \ + zstd-dev \ + ; \ + \ + wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + mkdir -p /usr/src/python; \ + tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ + rm python.tar.xz; \ + \ + cd /usr/src/python; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-option-checking=fatal \ + --enable-shared \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-}" \ + ; \ +# https://github.com/docker-library/python/issues/784 +# prevent accidental usage of a system installed libpython of the same version + rm python; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ + make install; \ + \ + cd /; \ + rm -rf /usr/src/python; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ + \) -exec rm -rf '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version + +# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) +RUN set -eux; \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ + dst="$(echo "$src" | tr -d 3)"; \ + [ -s "/usr/local/bin/$src" ]; \ + [ ! -e "/usr/local/bin/$dst" ]; \ + ln -svT "$src" "/usr/local/bin/$dst"; \ + done + +CMD ["python3"] diff --git a/3.16-rc/alpine3.24/Dockerfile b/3.16-rc/alpine3.24/Dockerfile new file mode 100644 index 000000000..eeacbcd40 --- /dev/null +++ b/3.16-rc/alpine3.24/Dockerfile @@ -0,0 +1,149 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.24 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.16-rc sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.16.0a2 +ENV PYTHON_SHA256 5fb6a0b8b7a70af2ee1386edcfb832e9636a5331b2bf0376a06cac33c43aa0d0 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + g++ \ + gcc \ + gdbm-dev \ + gnupg \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + mpdecimal-dev \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tar \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz \ + xz-dev \ + zlib-dev \ + zstd-dev \ + ; \ + \ + wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + mkdir -p /usr/src/python; \ + tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ + rm python.tar.xz; \ + \ + cd /usr/src/python; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-option-checking=fatal \ + --enable-shared \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-}" \ + ; \ +# https://github.com/docker-library/python/issues/784 +# prevent accidental usage of a system installed libpython of the same version + rm python; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ + make install; \ + \ + cd /; \ + rm -rf /usr/src/python; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ + \) -exec rm -rf '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version + +# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) +RUN set -eux; \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ + dst="$(echo "$src" | tr -d 3)"; \ + [ -s "/usr/local/bin/$src" ]; \ + [ ! -e "/usr/local/bin/$dst" ]; \ + ln -svT "$src" "/usr/local/bin/$dst"; \ + done + +CMD ["python3"] diff --git a/3.16-rc/slim-trixie/Dockerfile b/3.16-rc/slim-trixie/Dockerfile new file mode 100644 index 000000000..ef89d2585 --- /dev/null +++ b/3.16-rc/slim-trixie/Dockerfile @@ -0,0 +1,156 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:trixie-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.16-rc sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + netbase \ + tzdata \ + ; \ + apt-get dist-clean + +ENV PYTHON_VERSION 3.16.0a2 +ENV PYTHON_SHA256 5fb6a0b8b7a70af2ee1386edcfb832e9636a5331b2bf0376a06cac33c43aa0d0 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + dpkg-dev \ + g++ \ + gcc \ + gnupg \ + libbluetooth-dev \ + libbz2-dev \ + libc6-dev \ + libdb-dev \ + libffi-dev \ + libgdbm-dev \ + liblzma-dev \ + libmpdec-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + libzstd-dev \ + make \ + tk-dev \ + uuid-dev \ + wget \ + xz-utils \ + zlib1g-dev \ + ; \ + \ + wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + mkdir -p /usr/src/python; \ + tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ + rm python.tar.xz; \ + \ + cd /usr/src/python; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-}" \ + ; \ +# https://github.com/docker-library/python/issues/784 +# prevent accidental usage of a system installed libpython of the same version + rm python; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ + make install; \ + \ + cd /; \ + rm -rf /usr/src/python; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ + \) -exec rm -rf '{}' + \ + ; \ + \ + ldconfig; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -rt dpkg-query --search \ +# https://manpages.debian.org/bookworm/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) + | awk 'sub(":$", "", $1) { print $1 }' \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + apt-get dist-clean; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version + +# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) +RUN set -eux; \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ + dst="$(echo "$src" | tr -d 3)"; \ + [ -s "/usr/local/bin/$src" ]; \ + [ ! -e "/usr/local/bin/$dst" ]; \ + ln -svT "$src" "/usr/local/bin/$dst"; \ + done + +CMD ["python3"] diff --git a/3.16-rc/trixie/Dockerfile b/3.16-rc/trixie/Dockerfile new file mode 100644 index 000000000..b1db60fa1 --- /dev/null +++ b/3.16-rc/trixie/Dockerfile @@ -0,0 +1,140 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:trixie + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none +# last attempted removal of LANG broke many users: +# https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:3.16-rc sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' +ENV LANG C.UTF-8 + +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libbluetooth-dev \ + tk-dev \ + uuid-dev \ + ; \ + apt-get dist-clean + +ENV PYTHON_VERSION 3.16.0a2 +ENV PYTHON_SHA256 5fb6a0b8b7a70af2ee1386edcfb832e9636a5331b2bf0376a06cac33c43aa0d0 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libmpdec-dev \ + libzstd-dev \ + ; \ + \ + wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + mkdir -p /usr/src/python; \ + tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ + rm python.tar.xz; \ + \ + cd /usr/src/python; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-}" \ + ; \ +# https://github.com/docker-library/python/issues/784 +# prevent accidental usage of a system installed libpython of the same version + rm python; \ + make -j "$nproc" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ + make install; \ + \ +# enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 + bin="$(readlink -ve /usr/local/bin/python3)"; \ + dir="$(dirname "$bin")"; \ + mkdir -p "/usr/share/gdb/auto-load/$dir"; \ + cp -vL Tools/gdb/libpython.py "/usr/share/gdb/auto-load/$bin-gdb.py"; \ + \ + cd /; \ + rm -rf /usr/src/python; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \ + \) -exec rm -rf '{}' + \ + ; \ + \ + ldconfig; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -rt dpkg-query --search \ +# https://manpages.debian.org/bookworm/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) + | awk 'sub(":$", "", $1) { print $1 }' \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + apt-get dist-clean; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version + +# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) +RUN set -eux; \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ + dst="$(echo "$src" | tr -d 3)"; \ + [ -s "/usr/local/bin/$src" ]; \ + [ ! -e "/usr/local/bin/$dst" ]; \ + ln -svT "$src" "/usr/local/bin/$dst"; \ + done + +CMD ["python3"] diff --git a/3.16-rc/windows/windowsservercore-ltsc2022/Dockerfile b/3.16-rc/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..04f320d7a --- /dev/null +++ b/3.16-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,55 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('C:\Python;C:\Python\Scripts;{0}' -f $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); \ + Write-Host 'Complete.' +# doing this first to share cache across versions more aggressively + +ENV PYTHON_VERSION 3.16.0a2 +ENV PYTHON_SHA256 e604493562d97593a3456cc4c7e8483448176bf0d4e49d7d74d388dd433f28c7 + +RUN $url = 'https://www.python.org/ftp/python/3.16.0/python-3.16.0a2-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.zip'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.zip -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive python.zip -DestinationPath C:\Python\; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.zip -Force; \ + \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Re-Installing pip ...'; \ + # remove zip-provided pip so that we can reinstall and get the exe in c:\Python\Scripts + Remove-Item -Recurse C:\Python\Lib\site-packages\pip; \ + Remove-Item -Recurse C:\Python\Lib\site-packages\pip-*; \ + # install pip again + python -m ensurepip --default-pip; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.16-rc/windows/windowsservercore-ltsc2025/Dockerfile b/3.16-rc/windows/windowsservercore-ltsc2025/Dockerfile new file mode 100644 index 000000000..f6c272e39 --- /dev/null +++ b/3.16-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -0,0 +1,55 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2025 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('C:\Python;C:\Python\Scripts;{0}' -f $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); \ + Write-Host 'Complete.' +# doing this first to share cache across versions more aggressively + +ENV PYTHON_VERSION 3.16.0a2 +ENV PYTHON_SHA256 e604493562d97593a3456cc4c7e8483448176bf0d4e49d7d74d388dd433f28c7 + +RUN $url = 'https://www.python.org/ftp/python/3.16.0/python-3.16.0a2-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.zip'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.zip -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive python.zip -DestinationPath C:\Python\; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.zip -Force; \ + \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Re-Installing pip ...'; \ + # remove zip-provided pip so that we can reinstall and get the exe in c:\Python\Scripts + Remove-Item -Recurse C:\Python\Lib\site-packages\pip; \ + Remove-Item -Recurse C:\Python\Lib\site-packages\pip-*; \ + # install pip again + python -m ensurepip --default-pip; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 92cc4f2b5..2509ecddb 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -25,14 +25,15 @@ FROM buildpack-deps:{{ env.variant }} # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH -{{ if rcVersion | IN("3.10", "3.11", "3.12") then ( -}} -{{ # only set LANG on versions less than 3.13 -}} # cannot remove LANG even though https://bugs.python.org/issue19846 is fixed +# - embedded interpreters (uWSGI, mod_wsgi, etc) skip locale coercion and UTF-8 mode before Python 3.15, so they fall back to ASCII +# - musl (alpine) never gets LC_CTYPE set, so anything that reads locale environment variables (babel) finds none # last attempted removal of LANG broke many users: # https://github.com/docker-library/python/pull/570 +# embedded interpreter reproducer (fails with UnicodeEncodeError without LANG on 3.14 and earlier, needs a non-slim Debian variant for gcc): +# docker run --rm --env LANG= python:{{ env.version }} sh -c 'printf "#include \nint main(){Py_Initialize();PyRun_SimpleString(\"print(chr(252),flush=True)\");}" | gcc -x c - $(python3-config --embed --cflags --ldflags) && ./a.out' ENV LANG C.UTF-8 -{{ ) else "" end -}} # runtime dependencies {{ if is_alpine then ( -}} RUN set -eux; \ @@ -62,15 +63,11 @@ RUN set -eux; \ # https://github.com/docker-library/python/issues/977 # https://peps.python.org/pep-0761/ # https://discuss.python.org/t/pep-761-deprecating-pgp-signatures-for-cpython-artifacts/67180 - rcVersion | IN("3.10", "3.11", "3.12", "3.13") + rcVersion | IN("3.11", "3.12", "3.13") -}} {{ if should_pgp then ( -}} ENV GPG_KEY {{ { - # gpg: key 64E628F8D684696D: public key "Pablo Galindo Salgado " imported - "3.10": "A035C8C19219BA821ECEA86B64E628F8D684696D", - # https://peps.python.org/pep-0619/#release-manager-and-crew - # gpg: key 64E628F8D684696D: public key "Pablo Galindo Salgado " imported "3.11": "A035C8C19219BA821ECEA86B64E628F8D684696D", # https://peps.python.org/pep-0664/#release-manager-and-crew @@ -98,6 +95,7 @@ RUN set -eux; \ "bzip2-dev", "dpkg-dev dpkg", "findutils", + "g++", "gcc", "gdbm-dev", "gnupg", @@ -120,13 +118,19 @@ RUN set -eux; \ "xz", "xz-dev", "zlib-dev", - if IN(env.version; "3.10", "3.11", "3.12", "3.13") then empty else + if IN(env.version; "3.11", "3.12", "3.13") then empty else "zstd-dev" end, + if IN(env.version; "3.11", "3.12", "3.13", "3.14") then empty else + # https://github.com/docker-library/python/issues/1136 + # https://github.com/python/cpython/issues/115119 + "mpdecimal-dev" + end, empty else if is_slim then "dpkg-dev", + "g++", "gcc", "gnupg", "libbluetooth-dev", @@ -148,9 +152,14 @@ RUN set -eux; \ "zlib1g-dev", empty else empty end, - if IN(env.version; "3.10", "3.11", "3.12", "3.13") then empty else + if IN(env.version; "3.11", "3.12", "3.13") then empty else "libzstd-dev" end, + if IN(env.version; "3.11", "3.12", "3.13", "3.14") then empty elif env.variant | contains("bookworm") then empty else + # https://github.com/docker-library/python/issues/1136 + # https://github.com/python/cpython/issues/115119 + "libmpdec-dev" + end, empty end ] -}} @@ -206,6 +215,10 @@ RUN set -eux; \ {{ # skip LTO on riscv64: https://github.com/docker-library/python/pull/935, https://github.com/docker-library/python/pull/1038 -}} $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ +{{ if env.version == "3.15" and (env.variant | contains("bookworm")) then ( -}} +# https://github.com/docker-library/python/pull/1137#issuecomment-6180817683 + --without-system-libmpdec \ +{{ ) else "" end -}} ; \ nproc="$(nproc)"; \ {{ if is_alpine then ( -}} @@ -221,7 +234,7 @@ RUN set -eux; \ {{ ) else "" end -}} {{ # Enabling frame-pointers only makes sense for Python 3.12 and newer as those have perf profiler support - if rcVersion | IN("3.10", "3.11") then "" else ( + if rcVersion | IN("3.11") then "" else ( -}} {{ if is_alpine then ( -}} arch="$(apk --print-arch)"; \ @@ -323,8 +336,7 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ {{ "setuptools==\( .setuptools.version )" | @sh }} \ - # https://github.com/docker-library/python/issues/1023 - 'wheel<0.46' \ + 'wheel==0.46.3' \ ; \ {{ ) else "" end -}} pip3 --version diff --git a/Dockerfile-windows.template b/Dockerfile-windows.template index add70eac7..38ba650fe 100644 --- a/Dockerfile-windows.template +++ b/Dockerfile-windows.template @@ -1,28 +1,62 @@ +{{ + def rcVersion: + env.version | rtrimstr("-rc") + ; + def extension: + .checksums.windows.url | split(".")[-1] + ; + def is_windows_zip: + extension == "zip" +-}} FROM mcr.microsoft.com/windows/{{ env.windowsVariant }}:{{ env.windowsRelease }} SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +{{ if rcVersion | IN("3.11", "3.12", "3.13", "3.14", "3.15") then ( -}} +{{ # only set PYTHONIOENCODING on versions less than 3.16 -}} # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 +{{ # reproducer: docker run --rm python:{{ env.version }}-windowsservercore-{{ env.windowsRelease }} python -c 'print(chr(0x4e2d))' -}} +{{ # https://github.com/docker-library/python/pull/1144#pullrequestreview-5634536246 -}} +{{ ) else "" end -}} +{{ + # installer sets path for older python, but needs to be set for the zip download + if is_windows_zip then ( +-}} + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('C:\Python;C:\Python\Scripts;{0}' -f $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); \ + Write-Host 'Complete.' +# doing this first to share cache across versions more aggressively +{{ ) else "" end -}} ENV PYTHON_VERSION {{ .version }} {{ if .checksums.windows.sha256 then ( -}} ENV PYTHON_SHA256 {{ .checksums.windows.sha256 }} {{ ) else "" end -}} -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ +RUN $url = '{{ .checksums.windows.url | gsub("'"; "''") }}'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + Invoke-WebRequest -Uri $url -OutFile 'python.{{ extension }}'; \ {{ if .checksums.windows.sha256 then ( -}} \ Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ - if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + if ((Get-FileHash python.{{ extension }} -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ {{ ) else "" end -}} \ +{{ if is_windows_zip then ( -}} + Write-Host 'Expanding ...'; \ + Expand-Archive python.zip -DestinationPath C:\Python\; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.zip -Force; \ +{{ ) else ( -}} Write-Host 'Installing ...'; \ # https://docs.python.org/3/using/windows.html#installing-without-ui $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ @@ -46,15 +80,25 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en # the installer updated PATH, so we should refresh our local value $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ +{{ ) end -}} + \ + Write-Host 'Verifying install ("python --version") ...'; \ + python --version; \ \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ +{{ if is_windows_zip then ( -}} + Write-Host 'Re-Installing pip ...'; \ + # remove zip-provided pip so that we can reinstall and get the exe in c:\Python\Scripts + Remove-Item -Recurse C:\Python\Lib\site-packages\pip; \ + Remove-Item -Recurse C:\Python\Lib\site-packages\pip-*; \ + # install pip again + python -m ensurepip --default-pip; \ + \ +{{ ) else "" end -}} Write-Host 'Verifying pip install ...'; \ pip --version; \ \ diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index cf95fe839..dd54dfedf 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,7 +2,7 @@ set -Eeuo pipefail declare -A aliases=( - [3.14]='3 latest' + [3.15]='3 latest' ) self="$(basename "$BASH_SOURCE")" @@ -136,9 +136,6 @@ for version; do ;; esac - # https://github.com/python/cpython/issues/93619 (Linking error when building 3.11 beta on mips64le) + https://peps.python.org/pep-0011/ (mips is not even tier 3) - variantArches="$(sed <<<" $variantArches " -e 's/ mips64le / /g')" - sharedTags=() for windowsShared in windowsservercore nanoserver; do if [[ "$variant" == "$windowsShared"* ]]; then diff --git a/versions.json b/versions.json index ff6d26c9d..d3e5e549e 100644 --- a/versions.json +++ b/versions.json @@ -1,8 +1,8 @@ { - "3.10": { + "3.11": { "checksums": { "source": { - "sha256": "de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505" + "sha256": "9120e0a653868f6e3698d36cdd99e5a58903ec9469e448f21d98f7b16d8fa290" } }, "setuptools": { @@ -13,34 +13,31 @@ "slim-trixie", "bookworm", "slim-bookworm", - "alpine3.23", - "alpine3.22" + "alpine3.24", + "alpine3.23" ], - "version": "3.10.20" + "version": "3.11.18" }, - "3.11": { + "3.12": { "checksums": { "source": { - "sha256": "272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625" + "sha256": "b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c" } }, - "setuptools": { - "version": "79.0.1" - }, "variants": [ "trixie", "slim-trixie", "bookworm", "slim-bookworm", - "alpine3.23", - "alpine3.22" + "alpine3.24", + "alpine3.23" ], - "version": "3.11.15" + "version": "3.12.16" }, - "3.12": { + "3.13": { "checksums": { "source": { - "sha256": "c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684" + "sha256": "abb0102e6d4ae027509bcb82327d9dd85515b44a3ba8ad538cfc5e9847029f68" } }, "variants": [ @@ -48,18 +45,19 @@ "slim-trixie", "bookworm", "slim-bookworm", - "alpine3.23", - "alpine3.22" + "alpine3.24", + "alpine3.23" ], - "version": "3.12.13" + "version": "3.13.18" }, - "3.13": { + "3.14": { "checksums": { "source": { - "sha256": "2ab91ff401783ccca64f75d10c882e957bdfd60e2bf5a72f8421793729b78a71" + "sha256": "de414a57119abef52784d8993e341d53aed635fc2b05c2607d9f98a2c5b72032" }, "windows": { - "sha256": "3c9c81d80f91c002ced86d645422d81432c68c7d9b6b0e974768ca2e449a4d00" + "sha256": "92480239264744fe0386a1bd8275786fefa126e3129e56a68e22b52c73329965", + "url": "https://www.python.org/ftp/python/3.14.10/python-3.14.10-amd64.exe" } }, "variants": [ @@ -67,20 +65,21 @@ "slim-trixie", "bookworm", "slim-bookworm", + "alpine3.24", "alpine3.23", - "alpine3.22", "windows/windowsservercore-ltsc2025", "windows/windowsservercore-ltsc2022" ], - "version": "3.13.13" + "version": "3.14.10" }, - "3.14": { + "3.15": { "checksums": { "source": { - "sha256": "7e32597b99e5d9a39abed35de4693fa169df3e5850d4c334337ffd6a19a36db6" + "sha256": "8b5536d280142ecf6cdfe15d12a21ba1c65e300bbf7b28a8d0cdb849575797de" }, "windows": { - "sha256": "f9c09f5ed6f796fd1a8bc5ddfa41715a494b453c4781f0e35d5077cf9fa58f6d" + "sha256": "06e225a228191b0f4d1dcf6905fbb21bf9f6970d13a2ec63137ab9bee76f15aa", + "url": "https://www.python.org/ftp/python/3.15.2/python-3.15.2-amd64.exe" } }, "variants": [ @@ -88,32 +87,31 @@ "slim-trixie", "bookworm", "slim-bookworm", + "alpine3.24", "alpine3.23", - "alpine3.22", "windows/windowsservercore-ltsc2025", "windows/windowsservercore-ltsc2022" ], - "version": "3.14.5" + "version": "3.15.2" }, - "3.15-rc": { + "3.16-rc": { "checksums": { "source": { - "sha256": "d14f474ab679e90bc734b02ff58447b6ec99a821af61d6ff0c1da0f86e341a71" + "sha256": "5fb6a0b8b7a70af2ee1386edcfb832e9636a5331b2bf0376a06cac33c43aa0d0" }, "windows": { - "sha256": "f73038ee13ab1b131e6b2082a0f5c94e2a6d0aa834c452f2e1cefb90eba92c89" + "sha256": "e604493562d97593a3456cc4c7e8483448176bf0d4e49d7d74d388dd433f28c7", + "url": "https://www.python.org/ftp/python/3.16.0/python-3.16.0a2-amd64.zip" } }, "variants": [ "trixie", "slim-trixie", - "bookworm", - "slim-bookworm", + "alpine3.24", "alpine3.23", - "alpine3.22", "windows/windowsservercore-ltsc2025", "windows/windowsservercore-ltsc2022" ], - "version": "3.15.0b2" + "version": "3.16.0a2" } } diff --git a/versions.sh b/versions.sh index 83885bdb4..386549441 100755 --- a/versions.sh +++ b/versions.sh @@ -21,7 +21,16 @@ check_file() { local filename="Python-$fullVersion.tar.xz" if [ "$type" = 'windows' ]; then - filename="python-$fullVersion-amd64.exe" + # > phase out the traditional installer by Python 3.16 + # https://peps.python.org/pep-0773/#replacing-other-installers + case "${fullVersion}" in + 3.11.*|3.12.*|3.13.*|3.14.*|3.15.*) + filename="python-$fullVersion-amd64.exe" + ;; + *) + filename="python-$fullVersion-amd64.zip" + ;; + esac fi local url="https://www.python.org/ftp/python/$dirVersion/$filename" @@ -36,11 +45,11 @@ check_file() { ' )" && [ -n "$sigstore" ]; then sigstore="$(base64 -d <<<"$sigstore" | hexdump -ve '/1 "%02x"')" - checksums["$fullVersion"]="$(jq <<<"${checksums["$fullVersion"]:-null}" --arg type "$type" --arg sha256 "$sigstore" '.[$type].sha256 = $sha256')" + checksums["$fullVersion"]="$(jq <<<"${checksums["$fullVersion"]:-null}" --arg type "$type" --arg sha256 "$sigstore" --arg url "$url" '.[$type].sha256 = $sha256 | if $type == "windows" then .[$type].url = $url else . end')" return 0 fi - # TODO is this even necessary/useful? the sigstore-based version above is *much* faster, supports all current versions (not just 3.12+ like this), *and* should be more reliable 🤔 + # while the sigstore-based version above is *much* faster and supports all current versions (not just 3.12+ like this), the zips for 3.16+ don't have a '.sigstore' file local sbom if sbom="$( wget -qO- -o/dev/null "$url.spdx.json" \ @@ -66,7 +75,7 @@ check_file() { end ' )" && [ -n "sbom" ]; then - checksums["$fullVersion"]="$(jq <<<"${checksums["$fullVersion"]:-null}" --arg type "$type" --argjson sums "$sbom" '.[$type] += $sums')" + checksums["$fullVersion"]="$(jq <<<"${checksums["$fullVersion"]:-null}" --arg type "$type" --argjson sums "$sbom" --arg url "$url" '.[$type] += $sums | if $type == "windows" then .[$type].url = $url else . end')" return 0 fi @@ -162,7 +171,7 @@ for version in "${versions[@]}"; do # TODO remove setuptools version handling entirely once Python 3.11 is EOL setuptoolsVersion="$(sed -nre 's/^_SETUPTOOLS_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")" case "$rcVersion" in - 3.10 | 3.11) + 3.11) if [ -z "$setuptoolsVersion" ]; then echo >&2 "error: $version: missing setuptools version" exit 1 @@ -191,12 +200,15 @@ for version in "${versions[@]}"; do variants: [ ( "trixie", - "bookworm", + if IN(env.rcVersion; "3.11", "3.12", "3.13", "3.14", "3.15") then + # https://github.com/docker-library/python/pull/1137#issuecomment-6180817683 + "bookworm" + else empty end, empty | ., "slim-" + .), # https://github.com/docker-library/ruby/pull/142#issuecomment-320012893 ( + "3.24", "3.23", - "3.22", empty | "alpine" + .), if env.hasWindows != "" then