From 74a6edaaed0f1bdd65a3db656a1cc8f7bd8ef46d Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 20 Jan 2023 14:22:23 -0800 Subject: [PATCH 1/3] Revert "Only change rpath for python3.x binary" This reverts commit a1af335ee34324b2f40d7e90345f9468328f6a00. --- 3.10/alpine3.16/Dockerfile | 6 ------ 3.10/alpine3.17/Dockerfile | 6 ------ 3.10/bullseye/Dockerfile | 17 +---------------- 3.10/buster/Dockerfile | 17 +---------------- 3.10/slim-bullseye/Dockerfile | 6 ------ 3.10/slim-buster/Dockerfile | 6 ------ 3.11/alpine3.16/Dockerfile | 6 ------ 3.11/alpine3.17/Dockerfile | 6 ------ 3.11/bullseye/Dockerfile | 17 +---------------- 3.11/buster/Dockerfile | 17 +---------------- 3.11/slim-bullseye/Dockerfile | 6 ------ 3.11/slim-buster/Dockerfile | 6 ------ 3.12-rc/alpine3.16/Dockerfile | 6 ------ 3.12-rc/alpine3.17/Dockerfile | 6 ------ 3.12-rc/bullseye/Dockerfile | 17 +---------------- 3.12-rc/buster/Dockerfile | 17 +---------------- 3.12-rc/slim-bullseye/Dockerfile | 6 ------ 3.12-rc/slim-buster/Dockerfile | 6 ------ 3.7/alpine3.16/Dockerfile | 6 ------ 3.7/alpine3.17/Dockerfile | 6 ------ 3.7/bullseye/Dockerfile | 17 +---------------- 3.7/buster/Dockerfile | 17 +---------------- 3.7/slim-bullseye/Dockerfile | 6 ------ 3.7/slim-buster/Dockerfile | 6 ------ 3.8/alpine3.16/Dockerfile | 6 ------ 3.8/alpine3.17/Dockerfile | 6 ------ 3.8/bullseye/Dockerfile | 17 +---------------- 3.8/buster/Dockerfile | 17 +---------------- 3.8/slim-bullseye/Dockerfile | 6 ------ 3.8/slim-buster/Dockerfile | 6 ------ 3.9/alpine3.16/Dockerfile | 6 ------ 3.9/alpine3.17/Dockerfile | 6 ------ 3.9/bullseye/Dockerfile | 17 +---------------- 3.9/buster/Dockerfile | 17 +---------------- 3.9/slim-bullseye/Dockerfile | 6 ------ 3.9/slim-buster/Dockerfile | 6 ------ Dockerfile-linux.template | 20 +++++--------------- 37 files changed, 17 insertions(+), 351 deletions(-) diff --git a/3.10/alpine3.16/Dockerfile b/3.10/alpine3.16/Dockerfile index be7f497f1..3dd3b3069 100644 --- a/3.10/alpine3.16/Dockerfile +++ b/3.10/alpine3.16/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -89,11 +88,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.10/alpine3.17/Dockerfile b/3.10/alpine3.17/Dockerfile index 2f0730120..7648996bd 100644 --- a/3.10/alpine3.17/Dockerfile +++ b/3.10/alpine3.17/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -89,11 +88,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index 63e2218a7..9eab04e60 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.10/bullseye/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D ENV PYTHON_VERSION 3.10.9 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -62,12 +56,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.10/buster/Dockerfile b/3.10/buster/Dockerfile index 7a7901e01..52625e796 100644 --- a/3.10/buster/Dockerfile +++ b/3.10/buster/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D ENV PYTHON_VERSION 3.10.9 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -62,12 +56,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.10/slim-bullseye/Dockerfile b/3.10/slim-bullseye/Dockerfile index 54257cead..c2b21e300 100644 --- a/3.10/slim-bullseye/Dockerfile +++ b/3.10/slim-bullseye/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -83,11 +82,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.10/slim-buster/Dockerfile b/3.10/slim-buster/Dockerfile index 99f998a90..878165c64 100644 --- a/3.10/slim-buster/Dockerfile +++ b/3.10/slim-buster/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -83,11 +82,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.11/alpine3.16/Dockerfile b/3.11/alpine3.16/Dockerfile index 7e2e60947..5182f56ab 100644 --- a/3.11/alpine3.16/Dockerfile +++ b/3.11/alpine3.16/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -89,11 +88,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.11/alpine3.17/Dockerfile b/3.11/alpine3.17/Dockerfile index f0dede51c..08d73329f 100644 --- a/3.11/alpine3.17/Dockerfile +++ b/3.11/alpine3.17/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -89,11 +88,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.11/bullseye/Dockerfile b/3.11/bullseye/Dockerfile index fb5f58983..593826546 100644 --- a/3.11/bullseye/Dockerfile +++ b/3.11/bullseye/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D ENV PYTHON_VERSION 3.11.1 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -62,12 +56,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.11/buster/Dockerfile b/3.11/buster/Dockerfile index 1ff15e8b1..b363d722b 100644 --- a/3.11/buster/Dockerfile +++ b/3.11/buster/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D ENV PYTHON_VERSION 3.11.1 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -62,12 +56,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.11/slim-bullseye/Dockerfile b/3.11/slim-bullseye/Dockerfile index 41ee538f5..fc57a2d3f 100644 --- a/3.11/slim-bullseye/Dockerfile +++ b/3.11/slim-bullseye/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -83,11 +82,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.11/slim-buster/Dockerfile b/3.11/slim-buster/Dockerfile index 1ef82dce9..eb607d651 100644 --- a/3.11/slim-buster/Dockerfile +++ b/3.11/slim-buster/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -83,11 +82,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.12-rc/alpine3.16/Dockerfile b/3.12-rc/alpine3.16/Dockerfile index b5660f54e..1e499bba4 100644 --- a/3.12-rc/alpine3.16/Dockerfile +++ b/3.12-rc/alpine3.16/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -89,11 +88,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.12-rc/alpine3.17/Dockerfile b/3.12-rc/alpine3.17/Dockerfile index 4b118add0..d90ea26c4 100644 --- a/3.12-rc/alpine3.17/Dockerfile +++ b/3.12-rc/alpine3.17/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -89,11 +88,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.12-rc/bullseye/Dockerfile b/3.12-rc/bullseye/Dockerfile index 272e5876e..35f2794a8 100644 --- a/3.12-rc/bullseye/Dockerfile +++ b/3.12-rc/bullseye/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 ENV PYTHON_VERSION 3.12.0a4 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -62,12 +56,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.12-rc/buster/Dockerfile b/3.12-rc/buster/Dockerfile index 784d7eb42..8c8c8ccba 100644 --- a/3.12-rc/buster/Dockerfile +++ b/3.12-rc/buster/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 ENV PYTHON_VERSION 3.12.0a4 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -62,12 +56,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.12-rc/slim-bullseye/Dockerfile b/3.12-rc/slim-bullseye/Dockerfile index c5a44c65b..37a56e42e 100644 --- a/3.12-rc/slim-bullseye/Dockerfile +++ b/3.12-rc/slim-bullseye/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -83,11 +82,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.12-rc/slim-buster/Dockerfile b/3.12-rc/slim-buster/Dockerfile index 8af4000eb..3180be258 100644 --- a/3.12-rc/slim-buster/Dockerfile +++ b/3.12-rc/slim-buster/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -83,11 +82,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.7/alpine3.16/Dockerfile b/3.7/alpine3.16/Dockerfile index 21b4fcb5f..daf26d35e 100644 --- a/3.7/alpine3.16/Dockerfile +++ b/3.7/alpine3.16/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -124,11 +123,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.7/alpine3.17/Dockerfile b/3.7/alpine3.17/Dockerfile index 7eef7870f..1090f9df0 100644 --- a/3.7/alpine3.17/Dockerfile +++ b/3.7/alpine3.17/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -124,11 +123,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.7/bullseye/Dockerfile b/3.7/bullseye/Dockerfile index a711e508c..6ba7bf238 100644 --- a/3.7/bullseye/Dockerfile +++ b/3.7/bullseye/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.7.16 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -97,12 +91,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -120,11 +110,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index ed5d625a9..8b70d59ca 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.7.16 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -97,12 +91,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -120,11 +110,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.7/slim-bullseye/Dockerfile b/3.7/slim-bullseye/Dockerfile index fc027f1c9..7bf37f5c1 100644 --- a/3.7/slim-bullseye/Dockerfile +++ b/3.7/slim-bullseye/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -118,11 +117,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.7/slim-buster/Dockerfile b/3.7/slim-buster/Dockerfile index 50af4aa64..de0bbdba5 100644 --- a/3.7/slim-buster/Dockerfile +++ b/3.7/slim-buster/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -118,11 +117,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.8/alpine3.16/Dockerfile b/3.8/alpine3.16/Dockerfile index 7651a5005..cd0dd7eb8 100644 --- a/3.8/alpine3.16/Dockerfile +++ b/3.8/alpine3.16/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -88,11 +87,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.8/alpine3.17/Dockerfile b/3.8/alpine3.17/Dockerfile index d083ec87d..799ac402a 100644 --- a/3.8/alpine3.17/Dockerfile +++ b/3.8/alpine3.17/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -88,11 +87,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.8/bullseye/Dockerfile b/3.8/bullseye/Dockerfile index bf40a6801..671f56637 100644 --- a/3.8/bullseye/Dockerfile +++ b/3.8/bullseye/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 ENV PYTHON_VERSION 3.8.16 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -61,12 +55,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.8/buster/Dockerfile b/3.8/buster/Dockerfile index 5f0306b6f..73e344e18 100644 --- a/3.8/buster/Dockerfile +++ b/3.8/buster/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 ENV PYTHON_VERSION 3.8.16 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -61,12 +55,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -84,11 +74,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.8/slim-bullseye/Dockerfile b/3.8/slim-bullseye/Dockerfile index 39daf590f..614094fa0 100644 --- a/3.8/slim-bullseye/Dockerfile +++ b/3.8/slim-bullseye/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -82,11 +81,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.8/slim-buster/Dockerfile b/3.8/slim-buster/Dockerfile index 6078ad846..f6583e901 100644 --- a/3.8/slim-buster/Dockerfile +++ b/3.8/slim-buster/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -82,11 +81,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.9/alpine3.16/Dockerfile b/3.9/alpine3.16/Dockerfile index ca3f157d3..4a222ac61 100644 --- a/3.9/alpine3.16/Dockerfile +++ b/3.9/alpine3.16/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -88,11 +87,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.9/alpine3.17/Dockerfile b/3.9/alpine3.17/Dockerfile index acf19e632..15d4a3ac4 100644 --- a/3.9/alpine3.17/Dockerfile +++ b/3.9/alpine3.17/Dockerfile @@ -45,7 +45,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -88,11 +87,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile index 187c70055..56b859a7d 100644 --- a/3.9/bullseye/Dockerfile +++ b/3.9/bullseye/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 ENV PYTHON_VERSION 3.9.16 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -61,12 +55,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -83,11 +73,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.9/buster/Dockerfile b/3.9/buster/Dockerfile index 3e10a2b00..553b10084 100644 --- a/3.9/buster/Dockerfile +++ b/3.9/buster/Dockerfile @@ -27,12 +27,6 @@ ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 ENV PYTHON_VERSION 3.9.16 RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - patchelf \ - ; \ \ wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \ @@ -61,12 +55,8 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ # 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"; \ @@ -83,11 +73,6 @@ RUN set -eux; \ \ ldconfig; \ \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ python3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) diff --git a/3.9/slim-bullseye/Dockerfile b/3.9/slim-bullseye/Dockerfile index f10075a8e..1df0935f8 100644 --- a/3.9/slim-bullseye/Dockerfile +++ b/3.9/slim-bullseye/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -82,11 +81,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/3.9/slim-buster/Dockerfile b/3.9/slim-buster/Dockerfile index f11ba0b06..eebe65b69 100644 --- a/3.9/slim-buster/Dockerfile +++ b/3.9/slim-buster/Dockerfile @@ -46,7 +46,6 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ @@ -82,11 +81,6 @@ RUN set -eux; \ ; \ make install; \ \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ - \ cd /; \ rm -rf /usr/src/python; \ \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 6f29c5c9d..c76dadf37 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -99,7 +99,6 @@ RUN set -eux; \ make \ ncurses-dev \ openssl-dev \ - patchelf \ pax-utils \ readline-dev \ sqlite-dev \ @@ -111,11 +110,10 @@ RUN set -eux; \ zlib-dev \ ; \ \ -{{ ) else ( -}} +{{ ) elif is_slim then ( -}} savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends \ -{{ if is_slim then ( -}} dpkg-dev \ gcc \ gnupg dirmngr \ @@ -131,18 +129,14 @@ RUN set -eux; \ libsqlite3-dev \ libssl-dev \ make \ - patchelf \ tk-dev \ uuid-dev \ wget \ xz-utils \ zlib1g-dev \ -{{ ) else ( -}} - patchelf \ -{{ ) end -}} ; \ \ -{{ ) end -}} +{{ ) else "" end -}} wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ 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; \ @@ -229,14 +223,10 @@ RUN set -eux; \ -}} ; \ make install; \ - \ -# https://github.com/docker-library/python/issues/784 -# prevent accidental usage of a system installed libpython of the same version - bin="$(readlink -vf /usr/local/bin/python3)"; \ - patchelf --set-rpath '$ORIGIN/../lib' "$bin"; \ {{ if is_alpine or is_slim then "" else ( -}} \ # 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"; \ @@ -270,10 +260,10 @@ RUN set -eux; \ apk del --no-network .build-deps; \ {{ ) else ( -}} ldconfig; \ +{{ if is_slim then ( -}} \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ -{{ if is_slim then ( -}} find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ | awk '/=>/ { print $(NF-1) }' \ | sort -u \ @@ -282,9 +272,9 @@ RUN set -eux; \ | sort -u \ | xargs -r apt-mark manual \ ; \ -{{ ) else "" end -}} apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ +{{ ) else "" end -}} {{ ) end -}} \ python3 --version From 1b9fc1107f9fe7f7187c369f1d0cc709026a0939 Mon Sep 17 00:00:00 2001 From: Jim Nicholls Date: Sun, 29 Jan 2023 16:13:16 +1100 Subject: [PATCH 2/3] Use the linker to change rpath for python3.x binary. Not the libraries in /usr/local/lib/python3.x/lib-dynload/ since they use system libraries like libssl (so `$ORIGIN/../lib` doesn't work for them) --- 3.10/alpine3.16/Dockerfile | 10 ++++++++++ 3.10/alpine3.17/Dockerfile | 10 ++++++++++ 3.10/bullseye/Dockerfile | 7 +++++++ 3.10/buster/Dockerfile | 7 +++++++ 3.10/slim-bullseye/Dockerfile | 7 +++++++ 3.10/slim-buster/Dockerfile | 7 +++++++ 3.11/alpine3.16/Dockerfile | 10 ++++++++++ 3.11/alpine3.17/Dockerfile | 10 ++++++++++ 3.11/bullseye/Dockerfile | 7 +++++++ 3.11/buster/Dockerfile | 7 +++++++ 3.11/slim-bullseye/Dockerfile | 7 +++++++ 3.11/slim-buster/Dockerfile | 7 +++++++ 3.12-rc/alpine3.16/Dockerfile | 10 ++++++++++ 3.12-rc/alpine3.17/Dockerfile | 10 ++++++++++ 3.12-rc/bullseye/Dockerfile | 7 +++++++ 3.12-rc/buster/Dockerfile | 7 +++++++ 3.12-rc/slim-bullseye/Dockerfile | 7 +++++++ 3.12-rc/slim-buster/Dockerfile | 7 +++++++ 3.7/alpine3.16/Dockerfile | 10 ++++++++++ 3.7/alpine3.17/Dockerfile | 10 ++++++++++ 3.7/bullseye/Dockerfile | 7 +++++++ 3.7/buster/Dockerfile | 7 +++++++ 3.7/slim-bullseye/Dockerfile | 7 +++++++ 3.7/slim-buster/Dockerfile | 7 +++++++ 3.8/alpine3.16/Dockerfile | 10 ++++++++++ 3.8/alpine3.17/Dockerfile | 10 ++++++++++ 3.8/bullseye/Dockerfile | 7 +++++++ 3.8/buster/Dockerfile | 7 +++++++ 3.8/slim-bullseye/Dockerfile | 7 +++++++ 3.8/slim-buster/Dockerfile | 7 +++++++ 3.9/alpine3.16/Dockerfile | 10 ++++++++++ 3.9/alpine3.17/Dockerfile | 10 ++++++++++ 3.9/bullseye/Dockerfile | 7 +++++++ 3.9/buster/Dockerfile | 7 +++++++ 3.9/slim-bullseye/Dockerfile | 7 +++++++ 3.9/slim-buster/Dockerfile | 7 +++++++ Dockerfile-linux.template | 12 ++++++++++++ 37 files changed, 300 insertions(+) diff --git a/3.10/alpine3.16/Dockerfile b/3.10/alpine3.16/Dockerfile index 3dd3b3069..9f347cd3d 100644 --- a/3.10/alpine3.16/Dockerfile +++ b/3.10/alpine3.16/Dockerfile @@ -86,6 +86,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.10/alpine3.17/Dockerfile b/3.10/alpine3.17/Dockerfile index 7648996bd..1e622f3a5 100644 --- a/3.10/alpine3.17/Dockerfile +++ b/3.10/alpine3.17/Dockerfile @@ -86,6 +86,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index 9eab04e60..029040731 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.10/bullseye/Dockerfile @@ -54,6 +54,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.10/buster/Dockerfile b/3.10/buster/Dockerfile index 52625e796..6d397f7be 100644 --- a/3.10/buster/Dockerfile +++ b/3.10/buster/Dockerfile @@ -54,6 +54,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.10/slim-bullseye/Dockerfile b/3.10/slim-bullseye/Dockerfile index c2b21e300..bfa9279fa 100644 --- a/3.10/slim-bullseye/Dockerfile +++ b/3.10/slim-bullseye/Dockerfile @@ -80,6 +80,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.10/slim-buster/Dockerfile b/3.10/slim-buster/Dockerfile index 878165c64..cd1839cd3 100644 --- a/3.10/slim-buster/Dockerfile +++ b/3.10/slim-buster/Dockerfile @@ -80,6 +80,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.11/alpine3.16/Dockerfile b/3.11/alpine3.16/Dockerfile index 5182f56ab..7e7a94f32 100644 --- a/3.11/alpine3.16/Dockerfile +++ b/3.11/alpine3.16/Dockerfile @@ -86,6 +86,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.11/alpine3.17/Dockerfile b/3.11/alpine3.17/Dockerfile index 08d73329f..cb8593990 100644 --- a/3.11/alpine3.17/Dockerfile +++ b/3.11/alpine3.17/Dockerfile @@ -86,6 +86,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.11/bullseye/Dockerfile b/3.11/bullseye/Dockerfile index 593826546..dfef475eb 100644 --- a/3.11/bullseye/Dockerfile +++ b/3.11/bullseye/Dockerfile @@ -54,6 +54,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.11/buster/Dockerfile b/3.11/buster/Dockerfile index b363d722b..5bc4aa58d 100644 --- a/3.11/buster/Dockerfile +++ b/3.11/buster/Dockerfile @@ -54,6 +54,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.11/slim-bullseye/Dockerfile b/3.11/slim-bullseye/Dockerfile index fc57a2d3f..59bb2a4d1 100644 --- a/3.11/slim-bullseye/Dockerfile +++ b/3.11/slim-bullseye/Dockerfile @@ -80,6 +80,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.11/slim-buster/Dockerfile b/3.11/slim-buster/Dockerfile index eb607d651..928f452a9 100644 --- a/3.11/slim-buster/Dockerfile +++ b/3.11/slim-buster/Dockerfile @@ -80,6 +80,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.12-rc/alpine3.16/Dockerfile b/3.12-rc/alpine3.16/Dockerfile index 1e499bba4..d1c45d988 100644 --- a/3.12-rc/alpine3.16/Dockerfile +++ b/3.12-rc/alpine3.16/Dockerfile @@ -86,6 +86,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.12-rc/alpine3.17/Dockerfile b/3.12-rc/alpine3.17/Dockerfile index d90ea26c4..131bff8e5 100644 --- a/3.12-rc/alpine3.17/Dockerfile +++ b/3.12-rc/alpine3.17/Dockerfile @@ -86,6 +86,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.12-rc/bullseye/Dockerfile b/3.12-rc/bullseye/Dockerfile index 35f2794a8..cd0a14537 100644 --- a/3.12-rc/bullseye/Dockerfile +++ b/3.12-rc/bullseye/Dockerfile @@ -54,6 +54,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.12-rc/buster/Dockerfile b/3.12-rc/buster/Dockerfile index 8c8c8ccba..52e76da27 100644 --- a/3.12-rc/buster/Dockerfile +++ b/3.12-rc/buster/Dockerfile @@ -54,6 +54,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.12-rc/slim-bullseye/Dockerfile b/3.12-rc/slim-bullseye/Dockerfile index 37a56e42e..929a3e20e 100644 --- a/3.12-rc/slim-bullseye/Dockerfile +++ b/3.12-rc/slim-bullseye/Dockerfile @@ -80,6 +80,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.12-rc/slim-buster/Dockerfile b/3.12-rc/slim-buster/Dockerfile index 3180be258..489f1ad87 100644 --- a/3.12-rc/slim-buster/Dockerfile +++ b/3.12-rc/slim-buster/Dockerfile @@ -80,6 +80,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.7/alpine3.16/Dockerfile b/3.7/alpine3.16/Dockerfile index daf26d35e..1e8dffee5 100644 --- a/3.7/alpine3.16/Dockerfile +++ b/3.7/alpine3.16/Dockerfile @@ -121,6 +121,16 @@ RUN set -eux; \ test_unicode \ ' \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.7/alpine3.17/Dockerfile b/3.7/alpine3.17/Dockerfile index 1090f9df0..ac7938bfc 100644 --- a/3.7/alpine3.17/Dockerfile +++ b/3.7/alpine3.17/Dockerfile @@ -121,6 +121,16 @@ RUN set -eux; \ test_unicode \ ' \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.7/bullseye/Dockerfile b/3.7/bullseye/Dockerfile index 6ba7bf238..b77cd1b81 100644 --- a/3.7/bullseye/Dockerfile +++ b/3.7/bullseye/Dockerfile @@ -89,6 +89,13 @@ RUN set -eux; \ test_unicode \ ' \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index 8b70d59ca..e4671b879 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -89,6 +89,13 @@ RUN set -eux; \ test_unicode \ ' \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.7/slim-bullseye/Dockerfile b/3.7/slim-bullseye/Dockerfile index 7bf37f5c1..7c3340c59 100644 --- a/3.7/slim-bullseye/Dockerfile +++ b/3.7/slim-bullseye/Dockerfile @@ -115,6 +115,13 @@ RUN set -eux; \ test_unicode \ ' \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.7/slim-buster/Dockerfile b/3.7/slim-buster/Dockerfile index de0bbdba5..4ffadd2fa 100644 --- a/3.7/slim-buster/Dockerfile +++ b/3.7/slim-buster/Dockerfile @@ -115,6 +115,13 @@ RUN set -eux; \ test_unicode \ ' \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.8/alpine3.16/Dockerfile b/3.8/alpine3.16/Dockerfile index cd0dd7eb8..dd0302405 100644 --- a/3.8/alpine3.16/Dockerfile +++ b/3.8/alpine3.16/Dockerfile @@ -85,6 +85,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.8/alpine3.17/Dockerfile b/3.8/alpine3.17/Dockerfile index 799ac402a..5993bbef0 100644 --- a/3.8/alpine3.17/Dockerfile +++ b/3.8/alpine3.17/Dockerfile @@ -85,6 +85,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.8/bullseye/Dockerfile b/3.8/bullseye/Dockerfile index 671f56637..9064df999 100644 --- a/3.8/bullseye/Dockerfile +++ b/3.8/bullseye/Dockerfile @@ -53,6 +53,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.8/buster/Dockerfile b/3.8/buster/Dockerfile index 73e344e18..f72a4edd7 100644 --- a/3.8/buster/Dockerfile +++ b/3.8/buster/Dockerfile @@ -53,6 +53,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.8/slim-bullseye/Dockerfile b/3.8/slim-bullseye/Dockerfile index 614094fa0..99d00355c 100644 --- a/3.8/slim-bullseye/Dockerfile +++ b/3.8/slim-bullseye/Dockerfile @@ -79,6 +79,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.8/slim-buster/Dockerfile b/3.8/slim-buster/Dockerfile index f6583e901..fc5dc36d5 100644 --- a/3.8/slim-buster/Dockerfile +++ b/3.8/slim-buster/Dockerfile @@ -79,6 +79,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.9/alpine3.16/Dockerfile b/3.9/alpine3.16/Dockerfile index 4a222ac61..f5b8e1950 100644 --- a/3.9/alpine3.16/Dockerfile +++ b/3.9/alpine3.16/Dockerfile @@ -85,6 +85,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.9/alpine3.17/Dockerfile b/3.9/alpine3.17/Dockerfile index 15d4a3ac4..43618c4d0 100644 --- a/3.9/alpine3.17/Dockerfile +++ b/3.9/alpine3.17/Dockerfile @@ -85,6 +85,16 @@ RUN set -eux; \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ +# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile index 56b859a7d..3d238e016 100644 --- a/3.9/bullseye/Dockerfile +++ b/3.9/bullseye/Dockerfile @@ -53,6 +53,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.9/buster/Dockerfile b/3.9/buster/Dockerfile index 553b10084..3709cda3d 100644 --- a/3.9/buster/Dockerfile +++ b/3.9/buster/Dockerfile @@ -53,6 +53,13 @@ RUN set -eux; \ nproc="$(nproc)"; \ make -j "$nproc" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + python \ + ; \ make install; \ \ # enable GDB to load debugging data: https://github.com/docker-library/python/pull/701 diff --git a/3.9/slim-bullseye/Dockerfile b/3.9/slim-bullseye/Dockerfile index 1df0935f8..08030dbbf 100644 --- a/3.9/slim-bullseye/Dockerfile +++ b/3.9/slim-bullseye/Dockerfile @@ -79,6 +79,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/3.9/slim-buster/Dockerfile b/3.9/slim-buster/Dockerfile index eebe65b69..30b3432da 100644 --- a/3.9/slim-buster/Dockerfile +++ b/3.9/slim-buster/Dockerfile @@ -79,6 +79,13 @@ RUN set -eux; \ make -j "$nproc" \ LDFLAGS="-Wl,--strip-all" \ ; \ +# 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" \ + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + python \ + ; \ make install; \ \ cd /; \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index c76dadf37..9b612c5ea 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -222,6 +222,18 @@ RUN set -eux; \ end -}} ; \ +# 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" \ +{{ if is_alpine then ( -}} +# 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" \ +{{ ) else "" end -}} + LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'{{ if is_slim or is_alpine then ",--strip-all" else "" end }}" \ + python \ + ; \ make install; \ {{ if is_alpine or is_slim then "" else ( -}} \ From 01cc4c0d53b625276130b73a9dd99d070a45ecd7 Mon Sep 17 00:00:00 2001 From: Jim Nicholls Date: Tue, 31 Jan 2023 22:57:22 +1100 Subject: [PATCH 3/3] Reuse EXTRA_CFLAGS, LDFLAGS, and PROFILE_TASK across both make invokes. --- 3.10/alpine3.16/Dockerfile | 16 ++--- 3.10/alpine3.17/Dockerfile | 16 ++--- 3.10/bullseye/Dockerfile | 7 ++- 3.10/buster/Dockerfile | 7 ++- 3.10/slim-bullseye/Dockerfile | 9 ++- 3.10/slim-buster/Dockerfile | 9 ++- 3.11/alpine3.16/Dockerfile | 16 ++--- 3.11/alpine3.17/Dockerfile | 16 ++--- 3.11/bullseye/Dockerfile | 7 ++- 3.11/buster/Dockerfile | 7 ++- 3.11/slim-bullseye/Dockerfile | 9 ++- 3.11/slim-buster/Dockerfile | 9 ++- 3.12-rc/alpine3.16/Dockerfile | 16 ++--- 3.12-rc/alpine3.17/Dockerfile | 16 ++--- 3.12-rc/bullseye/Dockerfile | 7 ++- 3.12-rc/buster/Dockerfile | 7 ++- 3.12-rc/slim-bullseye/Dockerfile | 9 ++- 3.12-rc/slim-buster/Dockerfile | 9 ++- 3.7/alpine3.16/Dockerfile | 86 +++++++++++++------------- 3.7/alpine3.17/Dockerfile | 86 +++++++++++++------------- 3.7/bullseye/Dockerfile | 79 +++++++++++++----------- 3.7/buster/Dockerfile | 79 +++++++++++++----------- 3.7/slim-bullseye/Dockerfile | 81 ++++++++++++------------ 3.7/slim-buster/Dockerfile | 81 ++++++++++++------------ 3.8/alpine3.16/Dockerfile | 16 ++--- 3.8/alpine3.17/Dockerfile | 16 ++--- 3.8/bullseye/Dockerfile | 7 ++- 3.8/buster/Dockerfile | 7 ++- 3.8/slim-bullseye/Dockerfile | 9 ++- 3.8/slim-buster/Dockerfile | 9 ++- 3.9/alpine3.16/Dockerfile | 16 ++--- 3.9/alpine3.17/Dockerfile | 16 ++--- 3.9/bullseye/Dockerfile | 7 ++- 3.9/buster/Dockerfile | 7 ++- 3.9/slim-bullseye/Dockerfile | 9 ++- 3.9/slim-buster/Dockerfile | 9 ++- Dockerfile-linux.template | 102 +++++++++++++++---------------- 37 files changed, 529 insertions(+), 385 deletions(-) diff --git a/3.10/alpine3.16/Dockerfile b/3.10/alpine3.16/Dockerfile index 9f347cd3d..cd02a2e36 100644 --- a/3.10/alpine3.16/Dockerfile +++ b/3.10/alpine3.16/Dockerfile @@ -80,20 +80,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.10/alpine3.17/Dockerfile b/3.10/alpine3.17/Dockerfile index 1e622f3a5..0c054928b 100644 --- a/3.10/alpine3.17/Dockerfile +++ b/3.10/alpine3.17/Dockerfile @@ -80,20 +80,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index 029040731..d91a65a0d 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.10/bullseye/Dockerfile @@ -53,12 +53,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.10/buster/Dockerfile b/3.10/buster/Dockerfile index 6d397f7be..29009a2c8 100644 --- a/3.10/buster/Dockerfile +++ b/3.10/buster/Dockerfile @@ -53,12 +53,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.10/slim-bullseye/Dockerfile b/3.10/slim-bullseye/Dockerfile index bfa9279fa..bf45632cb 100644 --- a/3.10/slim-bullseye/Dockerfile +++ b/3.10/slim-bullseye/Dockerfile @@ -77,14 +77,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.10/slim-buster/Dockerfile b/3.10/slim-buster/Dockerfile index cd1839cd3..96e7670b9 100644 --- a/3.10/slim-buster/Dockerfile +++ b/3.10/slim-buster/Dockerfile @@ -77,14 +77,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.11/alpine3.16/Dockerfile b/3.11/alpine3.16/Dockerfile index 7e7a94f32..57c25da0c 100644 --- a/3.11/alpine3.16/Dockerfile +++ b/3.11/alpine3.16/Dockerfile @@ -80,20 +80,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.11/alpine3.17/Dockerfile b/3.11/alpine3.17/Dockerfile index cb8593990..9e499cb75 100644 --- a/3.11/alpine3.17/Dockerfile +++ b/3.11/alpine3.17/Dockerfile @@ -80,20 +80,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.11/bullseye/Dockerfile b/3.11/bullseye/Dockerfile index dfef475eb..b86b7100e 100644 --- a/3.11/bullseye/Dockerfile +++ b/3.11/bullseye/Dockerfile @@ -53,12 +53,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.11/buster/Dockerfile b/3.11/buster/Dockerfile index 5bc4aa58d..e8f06d802 100644 --- a/3.11/buster/Dockerfile +++ b/3.11/buster/Dockerfile @@ -53,12 +53,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.11/slim-bullseye/Dockerfile b/3.11/slim-bullseye/Dockerfile index 59bb2a4d1..e6b0a873c 100644 --- a/3.11/slim-bullseye/Dockerfile +++ b/3.11/slim-bullseye/Dockerfile @@ -77,14 +77,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.11/slim-buster/Dockerfile b/3.11/slim-buster/Dockerfile index 928f452a9..55beb9506 100644 --- a/3.11/slim-buster/Dockerfile +++ b/3.11/slim-buster/Dockerfile @@ -77,14 +77,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.12-rc/alpine3.16/Dockerfile b/3.12-rc/alpine3.16/Dockerfile index d1c45d988..d2fd23d71 100644 --- a/3.12-rc/alpine3.16/Dockerfile +++ b/3.12-rc/alpine3.16/Dockerfile @@ -80,20 +80,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.12-rc/alpine3.17/Dockerfile b/3.12-rc/alpine3.17/Dockerfile index 131bff8e5..2c1367cd5 100644 --- a/3.12-rc/alpine3.17/Dockerfile +++ b/3.12-rc/alpine3.17/Dockerfile @@ -80,20 +80,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.12-rc/bullseye/Dockerfile b/3.12-rc/bullseye/Dockerfile index cd0a14537..2d9ea69ac 100644 --- a/3.12-rc/bullseye/Dockerfile +++ b/3.12-rc/bullseye/Dockerfile @@ -53,12 +53,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.12-rc/buster/Dockerfile b/3.12-rc/buster/Dockerfile index 52e76da27..0ab8091fe 100644 --- a/3.12-rc/buster/Dockerfile +++ b/3.12-rc/buster/Dockerfile @@ -53,12 +53,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.12-rc/slim-bullseye/Dockerfile b/3.12-rc/slim-bullseye/Dockerfile index 929a3e20e..156cdc824 100644 --- a/3.12-rc/slim-bullseye/Dockerfile +++ b/3.12-rc/slim-bullseye/Dockerfile @@ -77,14 +77,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.12-rc/slim-buster/Dockerfile b/3.12-rc/slim-buster/Dockerfile index 489f1ad87..0fd0a3aca 100644 --- a/3.12-rc/slim-buster/Dockerfile +++ b/3.12-rc/slim-buster/Dockerfile @@ -77,14 +77,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.7/alpine3.16/Dockerfile b/3.7/alpine3.16/Dockerfile index 1e8dffee5..9912eacae 100644 --- a/3.7/alpine3.16/Dockerfile +++ b/3.7/alpine3.16/Dockerfile @@ -79,56 +79,58 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="-Wl,--strip-all"; \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.7/alpine3.17/Dockerfile b/3.7/alpine3.17/Dockerfile index ac7938bfc..613503d65 100644 --- a/3.7/alpine3.17/Dockerfile +++ b/3.7/alpine3.17/Dockerfile @@ -79,56 +79,58 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="-Wl,--strip-all"; \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.7/bullseye/Dockerfile b/3.7/bullseye/Dockerfile index b77cd1b81..117e44b3a 100644 --- a/3.7/bullseye/Dockerfile +++ b/3.7/bullseye/Dockerfile @@ -51,49 +51,54 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$nproc" \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ + 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index e4671b879..7c14c2f87 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -51,49 +51,54 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$nproc" \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ + 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.7/slim-bullseye/Dockerfile b/3.7/slim-bullseye/Dockerfile index 7c3340c59..2a5064c4a 100644 --- a/3.7/slim-bullseye/Dockerfile +++ b/3.7/slim-bullseye/Dockerfile @@ -76,50 +76,55 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + LDFLAGS="-Wl,--strip-all"; \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ + 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.7/slim-buster/Dockerfile b/3.7/slim-buster/Dockerfile index 4ffadd2fa..2d6aeab90 100644 --- a/3.7/slim-buster/Dockerfile +++ b/3.7/slim-buster/Dockerfile @@ -76,50 +76,55 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + LDFLAGS="-Wl,--strip-all"; \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ + 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.8/alpine3.16/Dockerfile b/3.8/alpine3.16/Dockerfile index dd0302405..f6caca849 100644 --- a/3.8/alpine3.16/Dockerfile +++ b/3.8/alpine3.16/Dockerfile @@ -79,20 +79,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.8/alpine3.17/Dockerfile b/3.8/alpine3.17/Dockerfile index 5993bbef0..f802fb165 100644 --- a/3.8/alpine3.17/Dockerfile +++ b/3.8/alpine3.17/Dockerfile @@ -79,20 +79,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.8/bullseye/Dockerfile b/3.8/bullseye/Dockerfile index 9064df999..3f66ac96e 100644 --- a/3.8/bullseye/Dockerfile +++ b/3.8/bullseye/Dockerfile @@ -52,12 +52,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.8/buster/Dockerfile b/3.8/buster/Dockerfile index f72a4edd7..129ac4936 100644 --- a/3.8/buster/Dockerfile +++ b/3.8/buster/Dockerfile @@ -52,12 +52,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.8/slim-bullseye/Dockerfile b/3.8/slim-bullseye/Dockerfile index 99d00355c..59b354210 100644 --- a/3.8/slim-bullseye/Dockerfile +++ b/3.8/slim-bullseye/Dockerfile @@ -76,14 +76,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.8/slim-buster/Dockerfile b/3.8/slim-buster/Dockerfile index fc5dc36d5..07101bf7f 100644 --- a/3.8/slim-buster/Dockerfile +++ b/3.8/slim-buster/Dockerfile @@ -76,14 +76,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.9/alpine3.16/Dockerfile b/3.9/alpine3.16/Dockerfile index f5b8e1950..e1db508b8 100644 --- a/3.9/alpine3.16/Dockerfile +++ b/3.9/alpine3.16/Dockerfile @@ -79,20 +79,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.9/alpine3.17/Dockerfile b/3.9/alpine3.17/Dockerfile index 43618c4d0..79cd098b2 100644 --- a/3.9/alpine3.17/Dockerfile +++ b/3.9/alpine3.17/Dockerfile @@ -79,20 +79,22 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$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="-Wl,--strip-all" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + 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" \ -# 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="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile index 3d238e016..0c1fb42b9 100644 --- a/3.9/bullseye/Dockerfile +++ b/3.9/bullseye/Dockerfile @@ -52,12 +52,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.9/buster/Dockerfile b/3.9/buster/Dockerfile index 3709cda3d..97a7bbc6e 100644 --- a/3.9/buster/Dockerfile +++ b/3.9/buster/Dockerfile @@ -52,12 +52,17 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ 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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.9/slim-bullseye/Dockerfile b/3.9/slim-bullseye/Dockerfile index 08030dbbf..1df1af730 100644 --- a/3.9/slim-bullseye/Dockerfile +++ b/3.9/slim-bullseye/Dockerfile @@ -76,14 +76,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/3.9/slim-buster/Dockerfile b/3.9/slim-buster/Dockerfile index 30b3432da..76ac15109 100644 --- a/3.9/slim-buster/Dockerfile +++ b/3.9/slim-buster/Dockerfile @@ -76,14 +76,19 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ + LDFLAGS="-Wl,--strip-all"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ + "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" \ - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib',--strip-all" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 9b612c5ea..aedfc1aba 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -166,72 +166,72 @@ RUN set -eux; \ --without-ensurepip \ ; \ nproc="$(nproc)"; \ - make -j "$nproc" \ {{ if is_alpine then ( -}} # 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" \ + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ {{ ) else "" end -}} {{ if is_slim or is_alpine then ( -}} - LDFLAGS="-Wl,--strip-all" \ + LDFLAGS="-Wl,--strip-all"; \ {{ ) else "" end -}} {{ if env.version == "3.7" then ( -}} # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 - PROFILE_TASK='-m test.regrtest --pgo \ - test_array \ - test_base64 \ - test_binascii \ - test_binhex \ - test_binop \ - test_bytes \ - test_c_locale_coercion \ - test_class \ - test_cmath \ - test_codecs \ - test_compile \ - test_complex \ - test_csv \ - test_decimal \ - test_dict \ - test_float \ - test_fstring \ - test_hashlib \ - test_io \ - test_iter \ - test_json \ - test_long \ - test_math \ - test_memoryview \ - test_pickle \ - test_re \ - test_set \ - test_slice \ - test_struct \ - test_threading \ - test_time \ - test_traceback \ - test_unicode \ - ' \ + PROFILE_TASK='-m test.regrtest --pgo \ + test_array \ + test_base64 \ + test_binascii \ + test_binhex \ + test_binop \ + test_bytes \ + test_c_locale_coercion \ + test_class \ + test_cmath \ + test_codecs \ + test_compile \ + test_complex \ + test_csv \ + test_decimal \ + test_dict \ + test_float \ + test_fstring \ + test_hashlib \ + test_io \ + test_iter \ + test_json \ + test_long \ + test_math \ + test_memoryview \ + test_pickle \ + test_re \ + test_set \ + test_slice \ + test_struct \ + test_threading \ + test_time \ + test_traceback \ + test_unicode \ + '; \ {{ - ) else - # PROFILE_TASK has a reasonable default starting in 3.8+; see: - # https://bugs.python.org/issue36044 - # https://github.com/python/cpython/pull/14702 - # https://github.com/python/cpython/pull/14910 - "" - end +) else + # PROFILE_TASK has a reasonable default starting in 3.8+; see: + # https://bugs.python.org/issue36044 + # https://github.com/python/cpython/pull/14702 + # https://github.com/python/cpython/pull/14910 + "" +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" \ -{{ if is_alpine then ( -}} -# 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" \ -{{ ) else "" end -}} - LDFLAGS="-Wl,-rpath='\$\$ORIGIN/../lib'{{ if is_slim or is_alpine then ",--strip-all" else "" end }}" \ + "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ + "LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \ + "PROFILE_TASK=${PROFILE_TASK:-}" \ python \ ; \ make install; \