diff --git a/3.10/alpine3.20/Dockerfile b/3.10/alpine3.22/Dockerfile similarity index 90% rename from 3.10/alpine3.20/Dockerfile rename to 3.10/alpine3.22/Dockerfile index e64d728b8..e3be8f98a 100644 --- a/3.10/alpine3.20/Dockerfile +++ b/3.10/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,22 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.16 -ENV PYTHON_SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -49,10 +46,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -76,14 +75,14 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -93,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -123,8 +122,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.10/alpine3.21/Dockerfile b/3.10/alpine3.23/Dockerfile similarity index 90% rename from 3.10/alpine3.21/Dockerfile rename to 3.10/alpine3.23/Dockerfile index 5e63d52c4..79b0e3ec2 100644 --- a/3.10/alpine3.21/Dockerfile +++ b/3.10/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,22 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.16 -ENV PYTHON_SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -49,10 +46,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -76,14 +75,14 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -93,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -123,8 +122,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.10/bookworm/Dockerfile b/3.10/bookworm/Dockerfile index fd463fef3..63792f437 100644 --- a/3.10/bookworm/Dockerfile +++ b/3.10/bookworm/Dockerfile @@ -25,8 +25,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.16 -ENV PYTHON_SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -95,8 +95,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.10/slim-bookworm/Dockerfile b/3.10/slim-bookworm/Dockerfile index 20eb0560b..bd2968c14 100644 --- a/3.10/slim-bookworm/Dockerfile +++ b/3.10/slim-bookworm/Dockerfile @@ -25,8 +25,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.16 -ENV PYTHON_SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -75,13 +75,13 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -113,8 +113,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ @@ -128,8 +129,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.11/slim-bullseye/Dockerfile b/3.10/slim-trixie/Dockerfile similarity index 84% rename from 3.11/slim-bullseye/Dockerfile rename to 3.10/slim-trixie/Dockerfile index e5af9267c..f4c7fbb07 100644 --- a/3.11/slim-bullseye/Dockerfile +++ b/3.10/slim-trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM debian:bullseye-slim +FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,11 +22,11 @@ RUN set -eux; \ netbase \ tzdata \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.11 -ENV PYTHON_SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -75,13 +75,13 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -113,13 +113,14 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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/*; \ + apt-get dist-clean; \ \ export PYTHONDONTWRITEBYTECODE=1; \ python3 --version; \ @@ -128,8 +129,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.11/bullseye/Dockerfile b/3.10/trixie/Dockerfile similarity index 89% rename from 3.11/bullseye/Dockerfile rename to 3.10/trixie/Dockerfile index 502f80542..edb9616d9 100644 --- a/3.11/bullseye/Dockerfile +++ b/3.10/trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM buildpack-deps:bullseye +FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,11 +22,11 @@ RUN set -eux; \ tk-dev \ uuid-dev \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.11 -ENV PYTHON_SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -95,8 +95,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.11/alpine3.20/Dockerfile b/3.11/alpine3.22/Dockerfile similarity index 90% rename from 3.11/alpine3.20/Dockerfile rename to 3.11/alpine3.22/Dockerfile index 176d578ce..d43ba24b8 100644 --- a/3.11/alpine3.20/Dockerfile +++ b/3.11/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,22 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.11 -ENV PYTHON_SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -49,10 +46,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -76,14 +75,14 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -93,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -123,8 +122,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.11/alpine3.21/Dockerfile b/3.11/alpine3.23/Dockerfile similarity index 90% rename from 3.11/alpine3.21/Dockerfile rename to 3.11/alpine3.23/Dockerfile index eaf1886e0..9a4d0c7ad 100644 --- a/3.11/alpine3.21/Dockerfile +++ b/3.11/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,22 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.11 -ENV PYTHON_SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -49,10 +46,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -76,14 +75,14 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -93,7 +92,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -123,8 +122,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.11/bookworm/Dockerfile b/3.11/bookworm/Dockerfile index abf7b0c91..2968b791e 100644 --- a/3.11/bookworm/Dockerfile +++ b/3.11/bookworm/Dockerfile @@ -25,8 +25,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.11 -ENV PYTHON_SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -95,8 +95,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.11/slim-bookworm/Dockerfile b/3.11/slim-bookworm/Dockerfile index 8ab5576a1..db4b9d00b 100644 --- a/3.11/slim-bookworm/Dockerfile +++ b/3.11/slim-bookworm/Dockerfile @@ -25,8 +25,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.11 -ENV PYTHON_SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -75,13 +75,13 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -113,8 +113,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ @@ -128,8 +129,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.10/slim-bullseye/Dockerfile b/3.11/slim-trixie/Dockerfile similarity index 84% rename from 3.10/slim-bullseye/Dockerfile rename to 3.11/slim-trixie/Dockerfile index a191591f4..2a24cfdf4 100644 --- a/3.10/slim-bullseye/Dockerfile +++ b/3.11/slim-trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM debian:bullseye-slim +FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,11 +22,11 @@ RUN set -eux; \ netbase \ tzdata \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.16 -ENV PYTHON_SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -75,13 +75,13 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -91,7 +91,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -113,13 +113,14 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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/*; \ + apt-get dist-clean; \ \ export PYTHONDONTWRITEBYTECODE=1; \ python3 --version; \ @@ -128,8 +129,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.10/bullseye/Dockerfile b/3.11/trixie/Dockerfile similarity index 89% rename from 3.10/bullseye/Dockerfile rename to 3.11/trixie/Dockerfile index 2737f1a2f..efd749b62 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.11/trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM buildpack-deps:bullseye +FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,11 +22,11 @@ RUN set -eux; \ tk-dev \ uuid-dev \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.16 -ENV PYTHON_SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -65,7 +65,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -95,8 +95,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==65.5.1' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.12/alpine3.20/Dockerfile b/3.12/alpine3.22/Dockerfile similarity index 76% rename from 3.12/alpine3.20/Dockerfile rename to 3.12/alpine3.22/Dockerfile index 734c041f7..278eac91e 100644 --- a/3.12/alpine3.20/Dockerfile +++ b/3.12/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,22 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +ENV PYTHON_VERSION 3.12.12 +ENV PYTHON_SHA256 fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -49,10 +46,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -76,14 +75,32 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -93,7 +110,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/alpine3.21/Dockerfile b/3.12/alpine3.23/Dockerfile similarity index 76% rename from 3.12/alpine3.21/Dockerfile rename to 3.12/alpine3.23/Dockerfile index 4bc600f39..571036dfb 100644 --- a/3.12/alpine3.21/Dockerfile +++ b/3.12/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,22 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +ENV PYTHON_VERSION 3.12.12 +ENV PYTHON_SHA256 fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -49,10 +46,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -76,14 +75,32 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -93,7 +110,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile index 1582f2c25..904b2b946 100644 --- a/3.12/bookworm/Dockerfile +++ b/3.12/bookworm/Dockerfile @@ -25,8 +25,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +ENV PYTHON_VERSION 3.12.12 +ENV PYTHON_SHA256 fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4 RUN set -eux; \ \ @@ -50,12 +50,30 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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:-}" \ @@ -65,7 +83,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile index d5510b6f5..c8debe41a 100644 --- a/3.12/slim-bookworm/Dockerfile +++ b/3.12/slim-bookworm/Dockerfile @@ -25,8 +25,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +ENV PYTHON_VERSION 3.12.12 +ENV PYTHON_SHA256 fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4 RUN set -eux; \ \ @@ -75,13 +75,31 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -91,7 +109,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -113,8 +131,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ diff --git a/3.12/slim-bullseye/Dockerfile b/3.12/slim-trixie/Dockerfile similarity index 71% rename from 3.12/slim-bullseye/Dockerfile rename to 3.12/slim-trixie/Dockerfile index 1b0527ac7..b9ff939e4 100644 --- a/3.12/slim-bullseye/Dockerfile +++ b/3.12/slim-trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM debian:bullseye-slim +FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,11 +22,11 @@ RUN set -eux; \ netbase \ tzdata \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +ENV PYTHON_VERSION 3.12.12 +ENV PYTHON_SHA256 fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4 RUN set -eux; \ \ @@ -75,13 +75,31 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -91,7 +109,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -113,13 +131,14 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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/*; \ + apt-get dist-clean; \ \ export PYTHONDONTWRITEBYTECODE=1; \ python3 --version; \ diff --git a/3.12/bullseye/Dockerfile b/3.12/trixie/Dockerfile similarity index 73% rename from 3.12/bullseye/Dockerfile rename to 3.12/trixie/Dockerfile index 4c29d1c8a..d2b592bae 100644 --- a/3.12/bullseye/Dockerfile +++ b/3.12/trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM buildpack-deps:bullseye +FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,11 +22,11 @@ RUN set -eux; \ tk-dev \ uuid-dev \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +ENV PYTHON_VERSION 3.12.12 +ENV PYTHON_SHA256 fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4 RUN set -eux; \ \ @@ -50,12 +50,30 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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:-}" \ @@ -65,7 +83,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/alpine3.20/Dockerfile b/3.13/alpine3.22/Dockerfile similarity index 75% rename from 3.13/alpine3.20/Dockerfile rename to 3.13/alpine3.22/Dockerfile index a3400bc7e..46edc2a72 100644 --- a/3.13/alpine3.20/Dockerfile +++ b/3.13/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -17,22 +17,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -44,10 +41,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -71,14 +70,32 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -88,7 +105,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/alpine3.21/Dockerfile b/3.13/alpine3.23/Dockerfile similarity index 75% rename from 3.13/alpine3.21/Dockerfile rename to 3.13/alpine3.23/Dockerfile index 47fda0dbc..e345da2a5 100644 --- a/3.13/alpine3.21/Dockerfile +++ b/3.13/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -17,22 +17,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -44,10 +41,12 @@ RUN set -eux; \ pax-utils \ readline-dev \ sqlite-dev \ + tar \ tcl-dev \ tk \ tk-dev \ util-linux-dev \ + xz \ xz-dev \ zlib-dev \ ; \ @@ -71,14 +70,32 @@ RUN set -eux; \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -88,7 +105,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile index 7c1086995..8af9bc3f2 100644 --- a/3.13/bookworm/Dockerfile +++ b/3.13/bookworm/Dockerfile @@ -20,8 +20,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -45,12 +45,30 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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:-}" \ @@ -60,7 +78,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile index bba18e9ab..a591d854d 100644 --- a/3.13/slim-bookworm/Dockerfile +++ b/3.13/slim-bookworm/Dockerfile @@ -20,8 +20,8 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/* ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -70,13 +70,31 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -86,7 +104,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -108,8 +126,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ diff --git a/3.13/slim-bullseye/Dockerfile b/3.13/slim-trixie/Dockerfile similarity index 70% rename from 3.13/slim-bullseye/Dockerfile rename to 3.13/slim-trixie/Dockerfile index 1afd61621..ed91c73d6 100644 --- a/3.13/slim-bullseye/Dockerfile +++ b/3.13/slim-trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM debian:bullseye-slim +FROM debian:trixie-slim # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -17,11 +17,11 @@ RUN set -eux; \ netbase \ tzdata \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -70,13 +70,31 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -86,7 +104,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -108,13 +126,14 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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/*; \ + apt-get dist-clean; \ \ export PYTHONDONTWRITEBYTECODE=1; \ python3 --version; \ diff --git a/3.13/bullseye/Dockerfile b/3.13/trixie/Dockerfile similarity index 71% rename from 3.13/bullseye/Dockerfile rename to 3.13/trixie/Dockerfile index 88fbc5fdd..abd88f85c 100644 --- a/3.13/bullseye/Dockerfile +++ b/3.13/trixie/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM buildpack-deps:bullseye +FROM buildpack-deps:trixie # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -17,11 +17,11 @@ RUN set -eux; \ tk-dev \ uuid-dev \ ; \ - rm -rf /var/lib/apt/lists/* + apt-get dist-clean ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -45,12 +45,30 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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:-}" \ @@ -60,7 +78,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/windows/windowsservercore-ltsc2022/Dockerfile b/3.13/windows/windowsservercore-ltsc2022/Dockerfile index 614c65387..683afe3c0 100644 --- a/3.13/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.13/windows/windowsservercore-ltsc2022/Dockerfile @@ -11,8 +11,8 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.13.1 -ENV PYTHON_SHA256 6b33fa9a439a86f553f9f60e538ccabc857d2f308bc77c477c04a46552ade81f +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 96159fcb523ae404b707186a75b4104ee23851e476a5e838e14584cf1e03f981 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); \ diff --git a/3.14-rc/windows/windowsservercore-1809/Dockerfile b/3.13/windows/windowsservercore-ltsc2025/Dockerfile similarity index 92% rename from 3.14-rc/windows/windowsservercore-1809/Dockerfile rename to 3.13/windows/windowsservercore-ltsc2025/Dockerfile index f45704a51..6df4dd864 100644 --- a/3.14-rc/windows/windowsservercore-1809/Dockerfile +++ b/3.13/windows/windowsservercore-ltsc2025/Dockerfile @@ -4,15 +4,15 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/servercore:1809 +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.14.0a4 -ENV PYTHON_SHA256 282062869ce0bf0710451280a63b9b98e04e78be2f493010f19b3a2447946d99 +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 96159fcb523ae404b707186a75b4104ee23851e476a5e838e14584cf1e03f981 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); \ diff --git a/3.14-rc/alpine3.20/Dockerfile b/3.14-rc/alpine3.20/Dockerfile deleted file mode 100644 index e8d8627cb..000000000 --- a/3.14-rc/alpine3.20/Dockerfile +++ /dev/null @@ -1,120 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.20 - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# runtime dependencies -RUN set -eux; \ - apk add --no-cache \ - ca-certificates \ - tzdata \ - ; - -ENV PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - 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 -; \ - 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 \ - --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 --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.14-rc/alpine3.21/Dockerfile b/3.14-rc/alpine3.21/Dockerfile deleted file mode 100644 index 0f2357e03..000000000 --- a/3.14-rc/alpine3.21/Dockerfile +++ /dev/null @@ -1,120 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.21 - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# runtime dependencies -RUN set -eux; \ - apk add --no-cache \ - ca-certificates \ - tzdata \ - ; - -ENV PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - 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 -; \ - 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 \ - --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 --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.14-rc/bookworm/Dockerfile b/3.14-rc/bookworm/Dockerfile deleted file mode 100644 index a5daf968a..000000000 --- a/3.14-rc/bookworm/Dockerfile +++ /dev/null @@ -1,92 +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 - -# 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 PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b - -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 -; \ - 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 \ - --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 --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.14-rc/bullseye/Dockerfile b/3.14-rc/bullseye/Dockerfile deleted file mode 100644 index b869fcfa7..000000000 --- a/3.14-rc/bullseye/Dockerfile +++ /dev/null @@ -1,92 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bullseye - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# 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 PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b - -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 -; \ - 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 \ - --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 --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.14-rc/slim-bullseye/Dockerfile b/3.14-rc/slim-bullseye/Dockerfile deleted file mode 100644 index afc7b3fd4..000000000 --- a/3.14-rc/slim-bullseye/Dockerfile +++ /dev/null @@ -1,125 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:bullseye-slim - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# 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 PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b - -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 -; \ - 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 \ - --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 -r dpkg-query --search \ - | cut -d: -f1 \ - | 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 --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.14/alpine3.22/Dockerfile b/3.14/alpine3.22/Dockerfile new file mode 100644 index 000000000..0c83b4535 --- /dev/null +++ b/3.14/alpine3.22/Dockerfile @@ -0,0 +1,138 @@ +# +# 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 + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b + +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 \ + 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.14/alpine3.23/Dockerfile b/3.14/alpine3.23/Dockerfile new file mode 100644 index 000000000..739e4aa89 --- /dev/null +++ b/3.14/alpine3.23/Dockerfile @@ -0,0 +1,138 @@ +# +# 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 + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b + +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 \ + 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.9/slim-bullseye/Dockerfile b/3.14/bookworm/Dockerfile similarity index 62% rename from 3.9/slim-bullseye/Dockerfile rename to 3.14/bookworm/Dockerfile index d6e8e3cd6..030ac52be 100644 --- a/3.9/slim-bullseye/Dockerfile +++ b/3.14/bookworm/Dockerfile @@ -4,65 +4,34 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM debian:bullseye-slim +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 \ - ca-certificates \ - netbase \ - tzdata \ + libbluetooth-dev \ + tk-dev \ + uuid-dev \ ; \ rm -rf /var/lib/apt/lists/* -ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.21 -ENV PYTHON_SHA256 3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1 +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b 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 \ + 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 -; \ - 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; \ @@ -75,12 +44,30 @@ RUN set -eux; \ --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:-}" \ @@ -90,11 +77,17 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "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; \ \ @@ -112,8 +105,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ @@ -122,14 +116,6 @@ RUN set -eux; \ \ export PYTHONDONTWRITEBYTECODE=1; \ python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==58.1.0' \ - wheel \ - ; \ pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.14-rc/slim-bookworm/Dockerfile b/3.14/slim-bookworm/Dockerfile similarity index 68% rename from 3.14-rc/slim-bookworm/Dockerfile rename to 3.14/slim-bookworm/Dockerfile index 3d51543d6..dd2dbb6bf 100644 --- a/3.14-rc/slim-bookworm/Dockerfile +++ b/3.14/slim-bookworm/Dockerfile @@ -19,8 +19,8 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b RUN set -eux; \ \ @@ -41,6 +41,7 @@ RUN set -eux; \ libreadline-dev \ libsqlite3-dev \ libssl-dev \ + libzstd-dev \ make \ tk-dev \ uuid-dev \ @@ -63,13 +64,31 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ + $(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"; \ + 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:-}" \ @@ -79,7 +98,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -101,8 +120,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ diff --git a/3.14/slim-trixie/Dockerfile b/3.14/slim-trixie/Dockerfile new file mode 100644 index 000000000..d9f37d851 --- /dev/null +++ b/3.14/slim-trixie/Dockerfile @@ -0,0 +1,145 @@ +# +# 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 + +# 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.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b + +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 \ + 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.14/trixie/Dockerfile b/3.14/trixie/Dockerfile new file mode 100644 index 000000000..3771a8dce --- /dev/null +++ b/3.14/trixie/Dockerfile @@ -0,0 +1,130 @@ +# +# 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 + +# 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.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + 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.12/windows/windowsservercore-ltsc2022/Dockerfile b/3.14/windows/windowsservercore-ltsc2022/Dockerfile similarity index 94% rename from 3.12/windows/windowsservercore-ltsc2022/Dockerfile rename to 3.14/windows/windowsservercore-ltsc2022/Dockerfile index cfbea3531..0bbda7710 100644 --- a/3.12/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.14/windows/windowsservercore-ltsc2022/Dockerfile @@ -11,8 +11,8 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.12.8 -ENV PYTHON_SHA256 71bd44e6b0e91c17558963557e4cdb80b483de9b0a0a9717f06cf896f95ab598 +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 b68ad91421afbbd1a628105199c8c5f6179b21ba799067a8d8c0bbac3b7defb0 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); \ diff --git a/3.13/windows/windowsservercore-1809/Dockerfile b/3.14/windows/windowsservercore-ltsc2025/Dockerfile similarity index 92% rename from 3.13/windows/windowsservercore-1809/Dockerfile rename to 3.14/windows/windowsservercore-ltsc2025/Dockerfile index 366950768..ba13e8ef0 100644 --- a/3.13/windows/windowsservercore-1809/Dockerfile +++ b/3.14/windows/windowsservercore-ltsc2025/Dockerfile @@ -4,15 +4,15 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/servercore:1809 +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.13.1 -ENV PYTHON_SHA256 6b33fa9a439a86f553f9f60e538ccabc857d2f308bc77c477c04a46552ade81f +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 b68ad91421afbbd1a628105199c8c5f6179b21ba799067a8d8c0bbac3b7defb0 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); \ diff --git a/3.15-rc/alpine3.22/Dockerfile b/3.15-rc/alpine3.22/Dockerfile new file mode 100644 index 000000000..9a41b3ee7 --- /dev/null +++ b/3.15-rc/alpine3.22/Dockerfile @@ -0,0 +1,138 @@ +# +# 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 + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.15.0a6 +ENV PYTHON_SHA256 8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989 + +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 \ + 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.15-rc/alpine3.23/Dockerfile b/3.15-rc/alpine3.23/Dockerfile new file mode 100644 index 000000000..fd7b8883f --- /dev/null +++ b/3.15-rc/alpine3.23/Dockerfile @@ -0,0 +1,138 @@ +# +# 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 + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.15.0a6 +ENV PYTHON_SHA256 8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989 + +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 \ + 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.15-rc/bookworm/Dockerfile b/3.15-rc/bookworm/Dockerfile new file mode 100644 index 000000000..7bf819c77 --- /dev/null +++ b/3.15-rc/bookworm/Dockerfile @@ -0,0 +1,130 @@ +# +# 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 + +# 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 PYTHON_VERSION 3.15.0a6 +ENV PYTHON_SHA256 8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + 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; \ + rm -rf /var/lib/apt/lists/*; \ + \ + 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.9/slim-bookworm/Dockerfile b/3.15-rc/slim-bookworm/Dockerfile similarity index 68% rename from 3.9/slim-bookworm/Dockerfile rename to 3.15-rc/slim-bookworm/Dockerfile index f8516e565..8a8505095 100644 --- a/3.9/slim-bookworm/Dockerfile +++ b/3.15-rc/slim-bookworm/Dockerfile @@ -9,11 +9,6 @@ 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; \ @@ -24,9 +19,8 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.21 -ENV PYTHON_SHA256 3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1 +ENV PYTHON_VERSION 3.15.0a6 +ENV PYTHON_SHA256 8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989 RUN set -eux; \ \ @@ -47,6 +41,7 @@ RUN set -eux; \ libreadline-dev \ libsqlite3-dev \ libssl-dev \ + libzstd-dev \ make \ tk-dev \ uuid-dev \ @@ -57,12 +52,6 @@ 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; \ @@ -75,12 +64,31 @@ RUN set -eux; \ --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"; \ + 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:-}" \ @@ -90,7 +98,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -112,8 +120,9 @@ RUN set -eux; \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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 \ ; \ @@ -122,14 +131,6 @@ RUN set -eux; \ \ export PYTHONDONTWRITEBYTECODE=1; \ python3 --version; \ - \ - pip3 install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools==58.1.0' \ - wheel \ - ; \ pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.15-rc/slim-trixie/Dockerfile b/3.15-rc/slim-trixie/Dockerfile new file mode 100644 index 000000000..9a60b4574 --- /dev/null +++ b/3.15-rc/slim-trixie/Dockerfile @@ -0,0 +1,145 @@ +# +# 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 + +# 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.15.0a6 +ENV PYTHON_SHA256 8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989 + +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 \ + 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.15-rc/trixie/Dockerfile b/3.15-rc/trixie/Dockerfile new file mode 100644 index 000000000..785689ee1 --- /dev/null +++ b/3.15-rc/trixie/Dockerfile @@ -0,0 +1,130 @@ +# +# 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 + +# 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.15.0a6 +ENV PYTHON_SHA256 8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + 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.14-rc/windows/windowsservercore-ltsc2022/Dockerfile b/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile similarity index 94% rename from 3.14-rc/windows/windowsservercore-ltsc2022/Dockerfile rename to 3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile index 9cd6b7d75..a67adc5ac 100644 --- a/3.14-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -11,8 +11,8 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref # https://github.com/docker-library/python/pull/557 ENV PYTHONIOENCODING UTF-8 -ENV PYTHON_VERSION 3.14.0a4 -ENV PYTHON_SHA256 282062869ce0bf0710451280a63b9b98e04e78be2f493010f19b3a2447946d99 +ENV PYTHON_VERSION 3.15.0a6 +ENV PYTHON_SHA256 6ace2216361f81a286f5957f522e7a212f400ab3f2055f6aa1c84e605a5c55c3 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); \ diff --git a/3.12/windows/windowsservercore-1809/Dockerfile b/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile similarity index 92% rename from 3.12/windows/windowsservercore-1809/Dockerfile rename to 3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile index da58b94b1..0643097a6 100644 --- a/3.12/windows/windowsservercore-1809/Dockerfile +++ b/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -4,15 +4,15 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/servercore:1809 +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.12.8 -ENV PYTHON_SHA256 71bd44e6b0e91c17558963557e4cdb80b483de9b0a0a9717f06cf896f95ab598 +ENV PYTHON_VERSION 3.15.0a6 +ENV PYTHON_SHA256 6ace2216361f81a286f5957f522e7a212f400ab3f2055f6aa1c84e605a5c55c3 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); \ diff --git a/3.9/alpine3.20/Dockerfile b/3.9/alpine3.20/Dockerfile deleted file mode 100644 index 9599084f5..000000000 --- a/3.9/alpine3.20/Dockerfile +++ /dev/null @@ -1,139 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.20 - -# 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 E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.21 -ENV PYTHON_SHA256 3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - 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 \ - --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==58.1.0' \ - wheel \ - ; \ - 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.9/alpine3.21/Dockerfile b/3.9/alpine3.21/Dockerfile deleted file mode 100644 index 23a662fcb..000000000 --- a/3.9/alpine3.21/Dockerfile +++ /dev/null @@ -1,139 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.21 - -# 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 E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.21 -ENV PYTHON_SHA256 3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - 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 \ - --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==58.1.0' \ - wheel \ - ; \ - 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.9/bookworm/Dockerfile b/3.9/bookworm/Dockerfile deleted file mode 100644 index 58d7bf1bb..000000000 --- a/3.9/bookworm/Dockerfile +++ /dev/null @@ -1,111 +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 E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.21 -ENV PYTHON_SHA256 3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1 - -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 \ - --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==58.1.0' \ - wheel \ - ; \ - 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.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile deleted file mode 100644 index 075f4461e..000000000 --- a/3.9/bullseye/Dockerfile +++ /dev/null @@ -1,111 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bullseye - -# 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 E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.21 -ENV PYTHON_SHA256 3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1 - -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 \ - --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==58.1.0' \ - wheel \ - ; \ - 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/Dockerfile-linux.template b/Dockerfile-linux.template index ecb9c5416..92cc4f2b5 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -7,6 +7,12 @@ ; def rcVersion: env.version | rtrimstr("-rc") + ; + def clean_apt: + # TODO once bookworm is EOL, remove this and just hard-code "apt-get dist-clean" instead + if env.variant | contains("bookworm") then + "rm -rf /var/lib/apt/lists/*" + else "apt-get dist-clean" end -}} {{ if is_alpine then ( -}} FROM alpine:{{ env.variant | ltrimstr("alpine") }} @@ -19,7 +25,7 @@ FROM buildpack-deps:{{ env.variant }} # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH -{{ if rcVersion | IN("3.9", "3.10", "3.11", "3.12") then ( -}} +{{ 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 # last attempted removal of LANG broke many users: @@ -48,7 +54,7 @@ RUN set -eux; \ uuid-dev \ {{ ) end -}} ; \ - rm -rf /var/lib/apt/lists/* + {{ clean_apt }} {{ ) end -}} {{ @@ -56,15 +62,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.9", "3.10", "3.11", "3.12", "3.13") + rcVersion | IN("3.10", "3.11", "3.12", "3.13") -}} {{ if should_pgp then ( -}} ENV GPG_KEY {{ { - # gpg: key B26995E310250568: public key "\xc5\x81ukasz Langa (GPG langa.pl) " imported - "3.9": "E3FF2839C048B25C084DEBE9B26995E310250568", - # https://peps.python.org/pep-0596/#release-manager-and-crew - # gpg: key 64E628F8D684696D: public key "Pablo Galindo Salgado " imported "3.10": "A035C8C19219BA821ECEA86B64E628F8D684696D", # https://peps.python.org/pep-0619/#release-manager-and-crew @@ -90,63 +92,86 @@ ENV PYTHON_SHA256 {{ .checksums.source.sha256 }} RUN set -eux; \ \ +{{ def build_deps: [ + if is_alpine then + "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", + if IN(env.version; "3.10", "3.11", "3.12", "3.13") then empty else + "zstd-dev" + end, + empty + else + if is_slim then + "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", + empty + else empty end, + if IN(env.version; "3.10", "3.11", "3.12", "3.13") then empty else + "libzstd-dev" + end, + empty + end +] -}} +{{ build_deps | if length > 0 then sort | ( -}} {{ if is_alpine then ( -}} apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - findutils \ - gcc \ - gdbm-dev \ - libc-dev \ - libffi-dev \ - libnsl-dev \ - libtirpc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - util-linux-dev \ - xz-dev \ - zlib-dev \ +{{ map( -}} + {{ . }} \ +{{ ) | add -}} ; \ \ -{{ ) elif is_slim then ( -}} +{{ ) else ( -}} 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 \ +{{ map( -}} + {{ . }} \ +{{ ) | add -}} ; \ \ +{{ ) end -}} {{ ) else "" end -}} wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ {{ if .checksums.source.sha256 then ( -}} @@ -178,12 +203,8 @@ RUN set -eux; \ {{ ) end -}} --enable-option-checking=fatal \ --enable-shared \ -{{ - # <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance - if rcVersion == "3.9" then "" else ( --}} - --with-lto \ -{{ ) end -}} +{{ # 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 \ ; \ nproc="$(nproc)"; \ @@ -196,8 +217,43 @@ RUN set -eux; \ LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ {{ ) end -}} {{ if is_slim or is_alpine then ( -}} - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; \ {{ ) 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 is_alpine then ( -}} + arch="$(apk --print-arch)"; \ +{{ ) else ( -}} + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +{{ ) end -}} +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ +{{ if is_alpine then ( -}} + x86_64|aarch64) \ +{{ ) else ( -}} + amd64|arm64) \ +{{ ) end -}} + # 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"; \ + ;; \ +{{ if is_alpine then ( -}} + x86) \ +{{ ) else ( -}} + i386) \ +{{ ) end -}} + # 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; \ +{{ ) end -}} make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ @@ -207,7 +263,7 @@ RUN set -eux; \ rm python; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -230,7 +286,7 @@ RUN set -eux; \ \) -exec rm -rf '{}' + \ ; \ \ -{{ if is_alpine then ( -}} +{{ if is_alpine and (build_deps | length > 0) then ( -}} find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ | tr ',' '\n' \ | sort -u \ @@ -240,20 +296,21 @@ RUN set -eux; \ apk del --no-network .build-deps; \ {{ ) else ( -}} ldconfig; \ -{{ if is_slim then ( -}} +{{ if build_deps | length > 0 then ( -}} \ 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 -r dpkg-query --search \ - | cut -d: -f1 \ + | 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/*; \ + {{ clean_apt }}; \ {{ ) else "" end -}} {{ ) end -}} \ @@ -266,7 +323,8 @@ RUN set -eux; \ --no-cache-dir \ --no-compile \ {{ "setuptools==\( .setuptools.version )" | @sh }} \ - wheel \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ {{ ) else "" end -}} pip3 --version diff --git a/Dockerfile-windows.template b/Dockerfile-windows.template index a564f29de..add70eac7 100644 --- a/Dockerfile-windows.template +++ b/Dockerfile-windows.template @@ -54,17 +54,6 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item $env:TEMP/Python*.log -Force; \ \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ -{{ if .setuptools then ( -}} - \ - Write-Host ('Installing setuptools and wheel ...'); \ - pip install \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - 'setuptools=={{ .setuptools.version }}' \ - wheel \ - ; \ -{{ ) else "" end -}} \ Write-Host 'Verifying pip install ...'; \ pip --version; \ diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 55e85e72a..cf95fe839 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,7 +2,7 @@ set -Eeuo pipefail declare -A aliases=( - [3.13]='3 latest' + [3.14]='3 latest' ) self="$(basename "$BASH_SOURCE")" @@ -136,23 +136,8 @@ for version; do ;; esac - case "$version" in - 3.9) ;; - *) - if [ "$version" != '3.10' ]; then - # https://github.com/docker-library/python/pull/931 - variantArches="$(sed <<<" $variantArches " -e 's/ riscv64 / /g')" - fi - # https://github.com/python/cpython/issues/93619 + https://peps.python.org/pep-0011/ - variantArches="$(sed <<<" $variantArches " -e 's/ mips64le / /g')" - ;; - esac - - if [ "$fullVersion" = '3.14.0a1' ]; then - # https://github.com/python/cpython/issues/125535 - 3.14.0a1 fails to build on i386 - # https://github.com/python/cpython/pull/125244 (already fixed for the next release) - variantArches="$(sed <<<" $variantArches " -e 's/ i386 / /g')" - fi + # 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 diff --git a/versions.json b/versions.json index c80e645e6..7594dfb12 100644 --- a/versions.json +++ b/versions.json @@ -2,121 +2,118 @@ "3.10": { "checksums": { "source": { - "sha256": "bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1" + "sha256": "de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505" } }, "setuptools": { - "version": "65.5.1" + "version": "79.0.1" }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.21", - "alpine3.20" + "alpine3.23", + "alpine3.22" ], - "version": "3.10.16" + "version": "3.10.20" }, "3.11": { "checksums": { "source": { - "sha256": "2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3" + "sha256": "272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625" } }, "setuptools": { - "version": "65.5.1" + "version": "79.0.1" }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.21", - "alpine3.20" + "alpine3.23", + "alpine3.22" ], - "version": "3.11.11" + "version": "3.11.15" }, "3.12": { "checksums": { "source": { - "sha256": "c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e" - }, - "windows": { - "sha256": "71bd44e6b0e91c17558963557e4cdb80b483de9b0a0a9717f06cf896f95ab598" + "sha256": "fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4" } }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.21", - "alpine3.20", - "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809" + "alpine3.23", + "alpine3.22" ], - "version": "3.12.8" + "version": "3.12.12" }, "3.13": { "checksums": { "source": { - "sha256": "9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9" + "sha256": "2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593" }, "windows": { - "sha256": "6b33fa9a439a86f553f9f60e538ccabc857d2f308bc77c477c04a46552ade81f" + "sha256": "96159fcb523ae404b707186a75b4104ee23851e476a5e838e14584cf1e03f981" } }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.21", - "alpine3.20", - "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809" + "alpine3.23", + "alpine3.22", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" ], - "version": "3.13.1" + "version": "3.13.12" }, - "3.14-rc": { + "3.14": { "checksums": { "source": { - "sha256": "c24f07881873c1d460228795ca6ca8c99130e30c773c91463d30d7ea8ff0e70b" + "sha256": "a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b" }, "windows": { - "sha256": "282062869ce0bf0710451280a63b9b98e04e78be2f493010f19b3a2447946d99" + "sha256": "b68ad91421afbbd1a628105199c8c5f6179b21ba799067a8d8c0bbac3b7defb0" } }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.21", - "alpine3.20", - "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809" + "alpine3.23", + "alpine3.22", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" ], - "version": "3.14.0a4" + "version": "3.14.3" }, - "3.9": { + "3.15-rc": { "checksums": { "source": { - "sha256": "3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1" + "sha256": "8e2a4e1b2afb93a84d659d431b1f384544b3da00a4b8ff5bf3580f07ad4ff989" + }, + "windows": { + "sha256": "6ace2216361f81a286f5957f522e7a212f400ab3f2055f6aa1c84e605a5c55c3" } }, - "setuptools": { - "version": "58.1.0" - }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.21", - "alpine3.20" + "alpine3.23", + "alpine3.22", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" ], - "version": "3.9.21" + "version": "3.15.0a6" } } diff --git a/versions.sh b/versions.sh index 5b7014ef7..83885bdb4 100755 --- a/versions.sh +++ b/versions.sh @@ -162,7 +162,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.9 | 3.10 | 3.11) + 3.10 | 3.11) if [ -z "$setuptoolsVersion" ]; then echo >&2 "error: $version: missing setuptools version" exit 1 @@ -171,11 +171,6 @@ for version in "${versions[@]}"; do echo >&2 "error: $version: setuptools version ($setuptoolsVersion) seems to be invalid?" exit 1 fi - - # https://github.com/docker-library/python/issues/781 (TODO remove this if 3.10 and 3.11 embed a newer setuptools and this section no longer applies) - if [ "$setuptoolsVersion" = '65.5.0' ]; then - setuptoolsVersion='65.5.1' - fi ;; *) @@ -195,19 +190,19 @@ for version in "${versions[@]}"; do version: env.fullVersion, variants: [ ( + "trixie", "bookworm", - "bullseye", empty | ., "slim-" + .), # https://github.com/docker-library/ruby/pull/142#issuecomment-320012893 ( - "3.21", - "3.20", + "3.23", + "3.22", empty | "alpine" + .), if env.hasWindows != "" then ( + "ltsc2025", "ltsc2022", - "1809", empty | "windows/windowsservercore-" + .) else empty end