diff --git a/.github/workflows/verify-templating.yml b/.github/workflows/verify-templating.yml index 2e1fb7872..e822ba6bb 100644 --- a/.github/workflows/verify-templating.yml +++ b/.github/workflows/verify-templating.yml @@ -3,6 +3,7 @@ name: Verify Templating on: pull_request: push: + workflow_dispatch: defaults: run: @@ -14,9 +15,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Apply Templates - run: ./apply-templates.sh - - name: Check Git Status - run: | - status="$(git status --short)" - [ -z "$status" ] + - run: ./apply-templates.sh + - run: git diff --exit-code diff --git a/3.10/alpine3.19/Dockerfile b/3.10/alpine3.19/Dockerfile deleted file mode 100644 index df5dd811b..000000000 --- a/3.10/alpine3.19/Dockerfile +++ /dev/null @@ -1,145 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.19 - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed -# last attempted removal of LANG broke many users: -# https://github.com/docker-library/python/pull/570 -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apk add --no-cache \ - ca-certificates \ - tzdata \ - ; - -ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.15 -ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - expat-dev \ - 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 \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-lto \ - --with-system-expat \ - --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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - 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==65.5.1' \ - 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.10/alpine3.20/Dockerfile b/3.10/alpine3.20/Dockerfile deleted file mode 100644 index 330b28c17..000000000 --- a/3.10/alpine3.20/Dockerfile +++ /dev/null @@ -1,145 +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 A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.10.15 -ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ - bluez-dev \ - bzip2-dev \ - dpkg-dev dpkg \ - expat-dev \ - 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 \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-lto \ - --with-system-expat \ - --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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - 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==65.5.1' \ - 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.19/Dockerfile b/3.10/alpine3.22/Dockerfile similarity index 88% rename from 3.9/alpine3.19/Dockerfile rename to 3.10/alpine3.22/Dockerfile index 1163933f8..e3be8f98a 100644 --- a/3.9/alpine3.19/Dockerfile +++ b/3.10/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.19 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -21,24 +21,20 @@ RUN set -eux; \ tzdata \ ; -ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.20 -ENV PYTHON_SHA256 6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c +ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D +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 \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -50,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 \ ; \ @@ -75,29 +73,26 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -127,8 +122,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==58.1.0' \ - wheel \ + 'setuptools==79.0.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ ; \ pip3 --version diff --git a/3.9/alpine3.20/Dockerfile b/3.10/alpine3.23/Dockerfile similarity index 88% rename from 3.9/alpine3.20/Dockerfile rename to 3.10/alpine3.23/Dockerfile index 00a3b9a64..79b0e3ec2 100644 --- a/3.9/alpine3.20/Dockerfile +++ b/3.10/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -21,24 +21,20 @@ RUN set -eux; \ tzdata \ ; -ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.9.20 -ENV PYTHON_SHA256 6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c +ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D +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 \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -50,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 \ ; \ @@ -75,29 +73,26 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -127,8 +122,9 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - 'setuptools==58.1.0' \ - 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 2fd89a19c..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.15 -ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -50,8 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -60,15 +59,13 @@ RUN set -eux; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -98,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 984b7a8d0..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.15 -ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -40,7 +40,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -76,26 +75,23 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -117,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 \ ; \ @@ -132,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 ffc5971dd..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.10 -ENV PYTHON_SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -40,7 +40,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -76,26 +75,23 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -117,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; \ @@ -132,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 4bdf869c1..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.10 -ENV PYTHON_SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 +ENV PYTHON_VERSION 3.10.20 +ENV PYTHON_SHA256 de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505 RUN set -eux; \ \ @@ -50,8 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -60,15 +59,13 @@ RUN set -eux; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -98,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.19/Dockerfile b/3.11/alpine3.22/Dockerfile similarity index 88% rename from 3.11/alpine3.19/Dockerfile rename to 3.11/alpine3.22/Dockerfile index 0de2b82ed..d43ba24b8 100644 --- a/3.11/alpine3.19/Dockerfile +++ b/3.11/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.19 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,23 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.10 -ENV PYTHON_SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 +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 \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -50,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 \ ; \ @@ -75,30 +73,26 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -128,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.20/Dockerfile b/3.11/alpine3.23/Dockerfile similarity index 88% rename from 3.11/alpine3.20/Dockerfile rename to 3.11/alpine3.23/Dockerfile index 914e34edc..9a4d0c7ad 100644 --- a/3.11/alpine3.20/Dockerfile +++ b/3.11/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,23 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D -ENV PYTHON_VERSION 3.11.10 -ENV PYTHON_SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 +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 \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -50,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 \ ; \ @@ -75,30 +73,26 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -128,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 0dbd36f3e..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.10 -ENV PYTHON_SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -50,8 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -60,15 +59,13 @@ RUN set -eux; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -98,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 53dd3e913..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.10 -ENV PYTHON_SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -40,7 +40,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -76,26 +75,23 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -117,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 \ ; \ @@ -132,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 3342d27cc..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.15 -ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -40,7 +40,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -76,26 +75,23 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -117,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; \ @@ -132,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 bbb175fff..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.15 -ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 +ENV PYTHON_VERSION 3.11.15 +ENV PYTHON_SHA256 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 RUN set -eux; \ \ @@ -50,8 +50,7 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') \ --with-ensurepip \ ; \ nproc="$(nproc)"; \ @@ -60,15 +59,13 @@ RUN set -eux; \ make -j "$nproc" \ "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -98,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.19/Dockerfile b/3.12/alpine3.22/Dockerfile similarity index 76% rename from 3.12/alpine3.19/Dockerfile rename to 3.12/alpine3.22/Dockerfile index 7cfbf1d31..37c814fee 100644 --- a/3.12/alpine3.19/Dockerfile +++ b/3.12/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.19 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,23 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.7 -ENV PYTHON_SHA256 24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550 +ENV PYTHON_VERSION 3.12.13 +ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -50,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 \ ; \ @@ -75,30 +73,44 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/alpine3.20/Dockerfile b/3.12/alpine3.23/Dockerfile similarity index 76% rename from 3.12/alpine3.20/Dockerfile rename to 3.12/alpine3.23/Dockerfile index 9a984f575..91342ac4d 100644 --- a/3.12/alpine3.20/Dockerfile +++ b/3.12/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -22,23 +22,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.12.7 -ENV PYTHON_SHA256 24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550 +ENV PYTHON_VERSION 3.12.13 +ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ - gnupg \ - tar \ - xz \ - \ bluez-dev \ bzip2-dev \ dpkg-dev dpkg \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -50,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 \ ; \ @@ -75,30 +73,44 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile index 40a5e46ce..e84b5f8af 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.7 -ENV PYTHON_SHA256 24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550 +ENV PYTHON_VERSION 3.12.13 +ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 RUN set -eux; \ \ @@ -50,25 +50,40 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile index 0fb84592f..7039a72d5 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.7 -ENV PYTHON_SHA256 24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550 +ENV PYTHON_VERSION 3.12.13 +ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 RUN set -eux; \ \ @@ -40,7 +40,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -76,26 +75,41 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -117,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 34761e37e..e9c8ec000 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.7 -ENV PYTHON_SHA256 24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550 +ENV PYTHON_VERSION 3.12.13 +ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 RUN set -eux; \ \ @@ -40,7 +40,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -76,26 +75,41 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -117,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 a0c98d45a..683a96eb4 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.7 -ENV PYTHON_SHA256 24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550 +ENV PYTHON_VERSION 3.12.13 +ENV PYTHON_SHA256 c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 RUN set -eux; \ \ @@ -50,25 +50,40 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/alpine3.19/Dockerfile b/3.13/alpine3.22/Dockerfile similarity index 75% rename from 3.13/alpine3.19/Dockerfile rename to 3.13/alpine3.22/Dockerfile index 814a33818..46edc2a72 100644 --- a/3.13/alpine3.19/Dockerfile +++ b/3.13/alpine3.22/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.19 +FROM alpine:3.22 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -17,23 +17,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.0 -ENV PYTHON_SHA256 086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d +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 \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -45,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 \ ; \ @@ -70,30 +68,44 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/alpine3.20/Dockerfile b/3.13/alpine3.23/Dockerfile similarity index 75% rename from 3.13/alpine3.20/Dockerfile rename to 3.13/alpine3.23/Dockerfile index dd8642626..e345da2a5 100644 --- a/3.13/alpine3.20/Dockerfile +++ b/3.13/alpine3.23/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.20 +FROM alpine:3.23 # ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH @@ -17,23 +17,19 @@ RUN set -eux; \ ; ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 -ENV PYTHON_VERSION 3.13.0 -ENV PYTHON_SHA256 086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d +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 \ - expat-dev \ findutils \ gcc \ gdbm-dev \ + gnupg \ libc-dev \ libffi-dev \ libnsl-dev \ @@ -45,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 \ ; \ @@ -70,30 +68,44 @@ RUN set -eux; \ ./configure \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile index 93cacf9af..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.0 -ENV PYTHON_SHA256 086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -45,25 +45,40 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ diff --git a/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile index 6573d6f94..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.0 -ENV PYTHON_SHA256 086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -35,7 +35,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -71,26 +70,41 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -112,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 55795e1da..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.0 -ENV PYTHON_SHA256 086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -35,7 +35,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -71,26 +70,41 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -112,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 9d4aab748..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.0 -ENV PYTHON_SHA256 086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d +ENV PYTHON_VERSION 3.13.12 +ENV PYTHON_SHA256 2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593 RUN set -eux; \ \ @@ -45,25 +45,40 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-lto \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "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 99ba51773..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.0 -ENV PYTHON_SHA256 78156ad0cf0ec4123bfb5333b40f078596ebf15f2d062a10144863680afbdefc +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.12/windows/windowsservercore-1809/Dockerfile b/3.13/windows/windowsservercore-ltsc2025/Dockerfile similarity index 92% rename from 3.12/windows/windowsservercore-1809/Dockerfile rename to 3.13/windows/windowsservercore-ltsc2025/Dockerfile index 1c85224d0..6df4dd864 100644 --- a/3.12/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.12.7 -ENV PYTHON_SHA256 1206721601a62c925d4e4a0dcfc371e88f2ddbe8c0c07962ebb2be9b5bde4570 +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/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 37ce11eb8..030ac52be 100644 --- a/3.9/slim-bullseye/Dockerfile +++ b/3.14/bookworm/Dockerfile @@ -4,66 +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.20 -ENV PYTHON_SHA256 6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c +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 \ - libexpat1-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; \ @@ -76,29 +44,50 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "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; \ \ @@ -116,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 \ ; \ @@ -126,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.9/slim-bookworm/Dockerfile b/3.14/slim-bookworm/Dockerfile similarity index 68% rename from 3.9/slim-bookworm/Dockerfile rename to 3.14/slim-bookworm/Dockerfile index f6c0daa43..dd2dbb6bf 100644 --- a/3.9/slim-bookworm/Dockerfile +++ b/3.14/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.20 -ENV PYTHON_SHA256 6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c +ENV PYTHON_VERSION 3.14.3 +ENV PYTHON_SHA256 a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b RUN set -eux; \ \ @@ -40,7 +34,6 @@ RUN set -eux; \ libbz2-dev \ libc6-dev \ libdb-dev \ - libexpat1-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ @@ -48,6 +41,7 @@ RUN set -eux; \ libreadline-dev \ libsqlite3-dev \ libssl-dev \ + libzstd-dev \ make \ tk-dev \ uuid-dev \ @@ -58,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; \ @@ -76,25 +64,41 @@ RUN set -eux; \ --enable-optimizations \ --enable-option-checking=fatal \ --enable-shared \ - --with-system-expat \ + $(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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -116,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 \ ; \ @@ -126,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.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 d8af8a47c..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.7 -ENV PYTHON_SHA256 1206721601a62c925d4e4a0dcfc371e88f2ddbe8c0c07962ebb2be9b5bde4570 +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 99eb4c5f4..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.0 -ENV PYTHON_SHA256 78156ad0cf0ec4123bfb5333b40f078596ebf15f2d062a10144863680afbdefc +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..2960eb96a --- /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.0a7 +ENV PYTHON_SHA256 8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7 + +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..2c76b46a4 --- /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.0a7 +ENV PYTHON_SHA256 8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7 + +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..61732936f --- /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.0a7 +ENV PYTHON_SHA256 8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7 + +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.15-rc/slim-bookworm/Dockerfile b/3.15-rc/slim-bookworm/Dockerfile new file mode 100644 index 000000000..cbc3ffc49 --- /dev/null +++ b/3.15-rc/slim-bookworm/Dockerfile @@ -0,0 +1,145 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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.15.0a7 +ENV PYTHON_SHA256 8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7 + +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; \ + 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.15-rc/slim-trixie/Dockerfile b/3.15-rc/slim-trixie/Dockerfile new file mode 100644 index 000000000..5c68c3841 --- /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.0a7 +ENV PYTHON_SHA256 8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7 + +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..46959be2a --- /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.0a7 +ENV PYTHON_SHA256 8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7 + +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.15-rc/windows/windowsservercore-ltsc2022/Dockerfile b/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..62b571a30 --- /dev/null +++ b/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.15.0a7 +ENV PYTHON_SHA256 d756f2fade118cf01bb7a0bc2bf0feb36fffee99ae92bb92b75a455d70fecb3c + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile b/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile new file mode 100644 index 000000000..16af096b2 --- /dev/null +++ b/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2025 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.15.0a7 +ENV PYTHON_SHA256 d756f2fade118cf01bb7a0bc2bf0feb36fffee99ae92bb92b75a455d70fecb3c + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.9/bookworm/Dockerfile b/3.9/bookworm/Dockerfile deleted file mode 100644 index 9180a988e..000000000 --- a/3.9/bookworm/Dockerfile +++ /dev/null @@ -1,114 +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.20 -ENV PYTHON_SHA256 6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c - -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-system-expat \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - 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 816a80ba8..000000000 --- a/3.9/bullseye/Dockerfile +++ /dev/null @@ -1,114 +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.20 -ENV PYTHON_SHA256 6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c - -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-system-expat \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - 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 02f1c9ad6..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 [ "3.9", "3.10", "3.11", "3.12" ] | index(rcVersion) 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,15 +54,19 @@ RUN set -eux; \ uuid-dev \ {{ ) end -}} ; \ - rm -rf /var/lib/apt/lists/* + {{ clean_apt }} {{ ) end -}} +{{ + def should_pgp: + # https://github.com/docker-library/python/issues/977 + # https://peps.python.org/pep-0761/ + # https://discuss.python.org/t/pep-761-deprecating-pgp-signatures-for-cpython-artifacts/67180 + rcVersion | IN("3.10", "3.11", "3.12", "3.13") +-}} +{{ 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 @@ -74,6 +84,7 @@ ENV GPG_KEY {{ # https://peps.python.org/pep-0719/#release-manager-and-crew }[rcVersion] }} +{{ ) else "" end -}} ENV PYTHON_VERSION {{ .version }} {{ if .checksums.source.sha256 then ( -}} ENV PYTHON_SHA256 {{ .checksums.source.sha256 }} @@ -81,76 +92,99 @@ 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 \ - expat-dev \ - 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 \ - libexpat1-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 ( -}} echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ {{ ) else "" end -}} +{{ if should_pgp then ( -}} 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; \ +{{ ) else "" end -}} mkdir -p /usr/src/python; \ tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \ rm python.tar.xz; \ @@ -161,23 +195,16 @@ RUN set -eux; \ --build="$gnuArch" \ --enable-loadable-sqlite-extensions \ {{ - # skip optimizations on alpine on riscv64 (except python 3.9) - # only 3.9 completes building on riscv64 with optimizations, 3.10-3.13 all hit the 3 hour limit - if (is_alpine | not) or ( [ "3.9" ] | index(rcVersion) ) then ( + # https://github.com/docker-library/python/pull/980 (fixing PGO runs tests that fail, but shouldn't) + # https://github.com/python/cpython/issues/90548 (alpine failures; not likely to be fixed any time soon) + if is_alpine then "" else ( -}} --enable-optimizations \ -{{ ) else ( -}} - $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--enable-optimizations') \ {{ ) end -}} --enable-option-checking=fatal \ --enable-shared \ -{{ - # <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance - if [ "3.9" ] | index(rcVersion) then "" else ( --}} - --with-lto \ -{{ ) end -}} - --with-system-expat \ +{{ # 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)"; \ @@ -190,20 +217,53 @@ 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:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ ; \ # 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ + "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" \ python \ ; \ make install; \ @@ -226,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 \ @@ -236,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 -}} \ @@ -262,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/README.md b/README.md index 617f64ae7..3d5b277d3 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,4 @@ For more information about the full official images change lifecycle, see [the " For outstanding `python` image PRs, check [PRs with the "library/python" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2Fpython). For the current "source of truth" for [`python`](https://hub.docker.com/_/python/), see [the `library/python` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/python). ---- - -- [![build status badge](https://img.shields.io/github/actions/workflow/status/docker-library/python/ci.yml?branch=master&label=GitHub%20CI)](https://github.com/docker-library/python/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster) -- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/python.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/python/) - -| Build | Status | Badges | (per-arch) | -|:-:|:-:|:-:|:-:| -| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/python.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/python/) | [![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/python.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/python/) | [![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/python.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/python/) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/python.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/python/) | -| [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/python.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/python/) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/python.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/python/) | [![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/python.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/python/) | [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/python.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/python/) | -| [![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/python.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/python/) | [![windows-amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/windows-amd64/job/python.svg?label=windows-amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/windows-amd64/job/python/) | [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/python.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/python/) | - diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index d27031e17..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,17 +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 + # 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 24e297545..22cd4c7cd 100644 --- a/versions.json +++ b/versions.json @@ -2,100 +2,118 @@ "3.10": { "checksums": { "source": { - "sha256": "aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79" + "sha256": "de6517421601e39a9a3bc3e1bc4c7b2f239297423ee05e282598c83ec0647505" } }, "setuptools": { - "version": "65.5.1" + "version": "79.0.1" }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.20", - "alpine3.19" + "alpine3.23", + "alpine3.22" ], - "version": "3.10.15" + "version": "3.10.20" }, "3.11": { "checksums": { "source": { - "sha256": "07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372" + "sha256": "272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625" } }, "setuptools": { - "version": "65.5.1" + "version": "79.0.1" }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.20", - "alpine3.19" + "alpine3.23", + "alpine3.22" ], - "version": "3.11.10" + "version": "3.11.15" }, "3.12": { "checksums": { "source": { - "sha256": "24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550" - }, - "windows": { - "sha256": "1206721601a62c925d4e4a0dcfc371e88f2ddbe8c0c07962ebb2be9b5bde4570" + "sha256": "c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684" } }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.20", - "alpine3.19", - "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809" + "alpine3.23", + "alpine3.22" ], - "version": "3.12.7" + "version": "3.12.13" }, "3.13": { "checksums": { "source": { - "sha256": "086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d" + "sha256": "2a84cd31dd8d8ea8aaff75de66fc1b4b0127dd5799aa50a64ae9a313885b4593" }, "windows": { - "sha256": "78156ad0cf0ec4123bfb5333b40f078596ebf15f2d062a10144863680afbdefc" + "sha256": "96159fcb523ae404b707186a75b4104ee23851e476a5e838e14584cf1e03f981" } }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.20", - "alpine3.19", - "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809" + "alpine3.23", + "alpine3.22", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" ], - "version": "3.13.0" + "version": "3.13.12" }, - "3.9": { + "3.14": { "checksums": { "source": { - "sha256": "6b281279efd85294d2d6993e173983a57464c0133956fbbb5536ec9646beaf0c" + "sha256": "a97d5549e9ad81fe17159ed02c68774ad5d266c72f8d9a0b5a9c371fe85d902b" + }, + "windows": { + "sha256": "b68ad91421afbbd1a628105199c8c5f6179b21ba799067a8d8c0bbac3b7defb0" } }, - "setuptools": { - "version": "58.1.0" + "variants": [ + "trixie", + "slim-trixie", + "bookworm", + "slim-bookworm", + "alpine3.23", + "alpine3.22", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" + ], + "version": "3.14.3" + }, + "3.15-rc": { + "checksums": { + "source": { + "sha256": "8f590c428b7f0d406df928b85737e7a3afa28eddd4d1419410ea809687ed1ea7" + }, + "windows": { + "sha256": "d756f2fade118cf01bb7a0bc2bf0feb36fffee99ae92bb92b75a455d70fecb3c" + } }, "variants": [ + "trixie", + "slim-trixie", "bookworm", "slim-bookworm", - "bullseye", - "slim-bullseye", - "alpine3.20", - "alpine3.19" + "alpine3.23", + "alpine3.22", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" ], - "version": "3.9.20" + "version": "3.15.0a7" } } diff --git a/versions.sh b/versions.sh index 53c0498c4..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.20", - "3.19", + "3.23", + "3.22", empty | "alpine" + .), if env.hasWindows != "" then ( + "ltsc2025", "ltsc2022", - "1809", empty | "windows/windowsservercore-" + .) else empty end