From 1189682a065093efe1d3ba4095d203c7d2dca9e1 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:46:43 +0100 Subject: [PATCH] Switch from get-pip.py to ensurepip Since: * All versions of Python that are actively built by this repo now include the `ensurepip` module. * The policy of these images is now to use the same pip version as the one bundled with `ensurepip` (rather than always upgrading as pip releases occur) to avoid breaking changes, and for parity with the `venv` module. * As such, we might as well actually use `ensurepip` to install pip (since it installs the exact pip version we want) rather than manually doing the same using `get-pip.py`. Now that the pip/setuptools versions track (or mostly track, in the case of setuptools) the ensurepip versions, the concerns over frequent invalidation of the Python layer no longer apply, and so the pip/setuptools install can now be part of the Python layer, reducing layer count by one. This change is a no-op in terms of pip/setuptools/wheel versions, since the pip versions being used already exactly matched the `ensurepip` version of pip. Closes #951. --- 3.10/alpine3.19/Dockerfile | 44 ++++--------- 3.10/alpine3.20/Dockerfile | 44 ++++--------- 3.10/bookworm/Dockerfile | 44 ++++--------- 3.10/bullseye/Dockerfile | 44 ++++--------- 3.10/slim-bookworm/Dockerfile | 53 ++++----------- 3.10/slim-bullseye/Dockerfile | 53 ++++----------- 3.11/alpine3.19/Dockerfile | 44 ++++--------- 3.11/alpine3.20/Dockerfile | 44 ++++--------- 3.11/bookworm/Dockerfile | 44 ++++--------- 3.11/bullseye/Dockerfile | 44 ++++--------- 3.11/slim-bookworm/Dockerfile | 53 ++++----------- 3.11/slim-bullseye/Dockerfile | 53 ++++----------- .../windows/windowsservercore-1809/Dockerfile | 30 ++------- .../windowsservercore-ltsc2022/Dockerfile | 30 ++------- 3.12/alpine3.19/Dockerfile | 33 ++-------- 3.12/alpine3.20/Dockerfile | 33 ++-------- 3.12/bookworm/Dockerfile | 33 ++-------- 3.12/bullseye/Dockerfile | 33 ++-------- 3.12/slim-bookworm/Dockerfile | 42 ++---------- 3.12/slim-bullseye/Dockerfile | 42 ++---------- .../windows/windowsservercore-1809/Dockerfile | 30 +-------- .../windowsservercore-ltsc2022/Dockerfile | 30 +-------- 3.13-rc/alpine3.19/Dockerfile | 33 ++-------- 3.13-rc/alpine3.20/Dockerfile | 33 ++-------- 3.13-rc/bookworm/Dockerfile | 33 ++-------- 3.13-rc/bullseye/Dockerfile | 33 ++-------- 3.13-rc/slim-bookworm/Dockerfile | 42 ++---------- 3.13-rc/slim-bullseye/Dockerfile | 42 ++---------- .../windows/windowsservercore-1809/Dockerfile | 30 +-------- .../windowsservercore-ltsc2022/Dockerfile | 30 +-------- 3.8/alpine3.19/Dockerfile | 44 ++++--------- 3.8/alpine3.20/Dockerfile | 44 ++++--------- 3.8/bookworm/Dockerfile | 44 ++++--------- 3.8/bullseye/Dockerfile | 44 ++++--------- 3.8/slim-bookworm/Dockerfile | 53 ++++----------- 3.8/slim-bullseye/Dockerfile | 53 ++++----------- 3.9/alpine3.19/Dockerfile | 44 ++++--------- 3.9/alpine3.20/Dockerfile | 44 ++++--------- 3.9/bookworm/Dockerfile | 44 ++++--------- 3.9/bullseye/Dockerfile | 44 ++++--------- 3.9/slim-bookworm/Dockerfile | 53 ++++----------- 3.9/slim-bullseye/Dockerfile | 53 ++++----------- Dockerfile-linux.template | 66 +++++-------------- Dockerfile-windows.template | 39 ++--------- versions.json | 48 -------------- versions.sh | 34 ++-------- 46 files changed, 411 insertions(+), 1516 deletions(-) diff --git a/3.10/alpine3.19/Dockerfile b/3.10/alpine3.19/Dockerfile index e53a0366c..0962e5d15 100644 --- a/3.10/alpine3.19/Dockerfile +++ b/3.10/alpine3.19/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,43 +119,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.10/alpine3.20/Dockerfile b/3.10/alpine3.20/Dockerfile index 5342ae231..646b9f38d 100644 --- a/3.10/alpine3.20/Dockerfile +++ b/3.10/alpine3.20/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,43 +119,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.10/bookworm/Dockerfile b/3.10/bookworm/Dockerfile index 2497ab7c0..a06f92d00 100644 --- a/3.10/bookworm/Dockerfile +++ b/3.10/bookworm/Dockerfile @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,43 +89,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index db718d152..a8526e5b9 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.10/bullseye/Dockerfile @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,43 +89,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.10/slim-bookworm/Dockerfile b/3.10/slim-bookworm/Dockerfile index 467f6f65d..71241989f 100644 --- a/3.10/slim-bookworm/Dockerfile +++ b/3.10/slim-bookworm/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,52 +123,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.10/slim-bullseye/Dockerfile b/3.10/slim-bullseye/Dockerfile index d55133b8a..c354ff1a1 100644 --- a/3.10/slim-bullseye/Dockerfile +++ b/3.10/slim-bullseye/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,52 +123,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/alpine3.19/Dockerfile b/3.11/alpine3.19/Dockerfile index 5de491384..12d1df82a 100644 --- a/3.11/alpine3.19/Dockerfile +++ b/3.11/alpine3.19/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,43 +119,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/alpine3.20/Dockerfile b/3.11/alpine3.20/Dockerfile index 85660844b..69464bd72 100644 --- a/3.11/alpine3.20/Dockerfile +++ b/3.11/alpine3.20/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,43 +119,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/bookworm/Dockerfile b/3.11/bookworm/Dockerfile index 7727dc104..6ce61cd87 100644 --- a/3.11/bookworm/Dockerfile +++ b/3.11/bookworm/Dockerfile @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,43 +89,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/bullseye/Dockerfile b/3.11/bullseye/Dockerfile index fc97b890a..9dc636ac0 100644 --- a/3.11/bullseye/Dockerfile +++ b/3.11/bullseye/Dockerfile @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,43 +89,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/slim-bookworm/Dockerfile b/3.11/slim-bookworm/Dockerfile index 4b9731d04..c216066fc 100644 --- a/3.11/slim-bookworm/Dockerfile +++ b/3.11/slim-bookworm/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,52 +123,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/slim-bullseye/Dockerfile b/3.11/slim-bullseye/Dockerfile index 93f79875c..2e48d4408 100644 --- a/3.11/slim-bullseye/Dockerfile +++ b/3.11/slim-bullseye/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,52 +123,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.11/windows/windowsservercore-1809/Dockerfile b/3.11/windows/windowsservercore-1809/Dockerfile index ec60cc6c5..78824dc81 100644 --- a/3.11/windows/windowsservercore-1809/Dockerfile +++ b/3.11/windows/windowsservercore-1809/Dockerfile @@ -28,7 +28,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -48,38 +48,16 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ + Write-Host ('Installing setuptools and wheel ...'); \ + pip install \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ - ('setuptools=={0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change + 'setuptools==65.5.1' \ wheel \ ; \ - Remove-Item get-pip.py -Force; \ \ Write-Host 'Verifying pip install ...'; \ pip --version; \ diff --git a/3.11/windows/windowsservercore-ltsc2022/Dockerfile b/3.11/windows/windowsservercore-ltsc2022/Dockerfile index 7ae25670c..d53ff5ddd 100644 --- a/3.11/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.11/windows/windowsservercore-ltsc2022/Dockerfile @@ -28,7 +28,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -48,38 +48,16 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.0 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 65.5.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ + Write-Host ('Installing setuptools and wheel ...'); \ + pip install \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ - ('setuptools=={0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change + 'setuptools==65.5.1' \ wheel \ ; \ - Remove-Item get-pip.py -Force; \ \ Write-Host 'Verifying pip install ...'; \ pip --version; \ diff --git a/3.12/alpine3.19/Dockerfile b/3.12/alpine3.19/Dockerfile index 071de980c..b3829d470 100644 --- a/3.12/alpine3.19/Dockerfile +++ b/3.12/alpine3.19/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,40 +119,17 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.12/alpine3.20/Dockerfile b/3.12/alpine3.20/Dockerfile index b9fc0e34a..a5861abd3 100644 --- a/3.12/alpine3.20/Dockerfile +++ b/3.12/alpine3.20/Dockerfile @@ -78,7 +78,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,40 +119,17 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile index 0c6f94878..fff0bc5b0 100644 --- a/3.12/bookworm/Dockerfile +++ b/3.12/bookworm/Dockerfile @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,40 +89,17 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.12/bullseye/Dockerfile b/3.12/bullseye/Dockerfile index e5e24f2c0..22a19aab2 100644 --- a/3.12/bullseye/Dockerfile +++ b/3.12/bullseye/Dockerfile @@ -50,7 +50,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,40 +89,17 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile index 515dc4076..7594c31b4 100644 --- a/3.12/slim-bookworm/Dockerfile +++ b/3.12/slim-bookworm/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,49 +123,17 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.12/slim-bullseye/Dockerfile b/3.12/slim-bullseye/Dockerfile index b53078282..be8b6b983 100644 --- a/3.12/slim-bullseye/Dockerfile +++ b/3.12/slim-bullseye/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,49 +123,17 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.12/windows/windowsservercore-1809/Dockerfile b/3.12/windows/windowsservercore-1809/Dockerfile index 242a97242..8563d38b8 100644 --- a/3.12/windows/windowsservercore-1809/Dockerfile +++ b/3.12/windows/windowsservercore-1809/Dockerfile @@ -28,7 +28,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -48,36 +48,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ - --no-setuptools \ - --no-wheel \ - ; \ - Remove-Item get-pip.py -Force; \ - \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ diff --git a/3.12/windows/windowsservercore-ltsc2022/Dockerfile b/3.12/windows/windowsservercore-ltsc2022/Dockerfile index 75311cb2c..b1d06843f 100644 --- a/3.12/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.12/windows/windowsservercore-ltsc2022/Dockerfile @@ -28,7 +28,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -48,36 +48,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.2 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ - --no-setuptools \ - --no-wheel \ - ; \ - Remove-Item get-pip.py -Force; \ - \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ diff --git a/3.13-rc/alpine3.19/Dockerfile b/3.13-rc/alpine3.19/Dockerfile index be1378283..8aa502e02 100644 --- a/3.13-rc/alpine3.19/Dockerfile +++ b/3.13-rc/alpine3.19/Dockerfile @@ -73,7 +73,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -114,40 +114,17 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.13-rc/alpine3.20/Dockerfile b/3.13-rc/alpine3.20/Dockerfile index 8d95194bc..4c50f12ea 100644 --- a/3.13-rc/alpine3.20/Dockerfile +++ b/3.13-rc/alpine3.20/Dockerfile @@ -73,7 +73,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -114,40 +114,17 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.13-rc/bookworm/Dockerfile b/3.13-rc/bookworm/Dockerfile index 019227c1c..3bef1eeb9 100644 --- a/3.13-rc/bookworm/Dockerfile +++ b/3.13-rc/bookworm/Dockerfile @@ -45,7 +45,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -84,40 +84,17 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.13-rc/bullseye/Dockerfile b/3.13-rc/bullseye/Dockerfile index 32804196d..340099840 100644 --- a/3.13-rc/bullseye/Dockerfile +++ b/3.13-rc/bullseye/Dockerfile @@ -45,7 +45,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -84,40 +84,17 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.13-rc/slim-bookworm/Dockerfile b/3.13-rc/slim-bookworm/Dockerfile index 901f7ecf3..7887fe6df 100644 --- a/3.13-rc/slim-bookworm/Dockerfile +++ b/3.13-rc/slim-bookworm/Dockerfile @@ -71,7 +71,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -118,49 +118,17 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.13-rc/slim-bullseye/Dockerfile b/3.13-rc/slim-bullseye/Dockerfile index 8f077e431..d1f168141 100644 --- a/3.13-rc/slim-bullseye/Dockerfile +++ b/3.13-rc/slim-bullseye/Dockerfile @@ -71,7 +71,7 @@ RUN set -eux; \ --enable-shared \ --with-lto \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -118,49 +118,17 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - --no-setuptools \ - --no-wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.13-rc/windows/windowsservercore-1809/Dockerfile b/3.13-rc/windows/windowsservercore-1809/Dockerfile index 9c7fa5a6b..4d274dafe 100644 --- a/3.13-rc/windows/windowsservercore-1809/Dockerfile +++ b/3.13-rc/windows/windowsservercore-1809/Dockerfile @@ -28,7 +28,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -48,36 +48,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ - --no-setuptools \ - --no-wheel \ - ; \ - Remove-Item get-pip.py -Force; \ - \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ diff --git a/3.13-rc/windows/windowsservercore-ltsc2022/Dockerfile b/3.13-rc/windows/windowsservercore-ltsc2022/Dockerfile index 8bf8a6e88..bac8aad1b 100644 --- a/3.13-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ b/3.13-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -28,7 +28,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -48,36 +48,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 24.1.1 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ - --no-setuptools \ - --no-wheel \ - ; \ - Remove-Item get-pip.py -Force; \ - \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ diff --git a/3.8/alpine3.19/Dockerfile b/3.8/alpine3.19/Dockerfile index c64edbd83..6bfba5e97 100644 --- a/3.8/alpine3.19/Dockerfile +++ b/3.8/alpine3.19/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,43 +119,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==57.5.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 57.5.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.8/alpine3.20/Dockerfile b/3.8/alpine3.20/Dockerfile index 5a4ff5a9e..8e15c5a3a 100644 --- a/3.8/alpine3.20/Dockerfile +++ b/3.8/alpine3.20/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -119,43 +119,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==57.5.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 57.5.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.8/bookworm/Dockerfile b/3.8/bookworm/Dockerfile index e09ec334c..fe0200029 100644 --- a/3.8/bookworm/Dockerfile +++ b/3.8/bookworm/Dockerfile @@ -49,7 +49,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,43 +89,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==57.5.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 57.5.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.8/bullseye/Dockerfile b/3.8/bullseye/Dockerfile index e10624bc2..8b8371ccc 100644 --- a/3.8/bullseye/Dockerfile +++ b/3.8/bullseye/Dockerfile @@ -49,7 +49,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -89,43 +89,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==57.5.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 57.5.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.8/slim-bookworm/Dockerfile b/3.8/slim-bookworm/Dockerfile index 1af1fab8f..efa6ce29c 100644 --- a/3.8/slim-bookworm/Dockerfile +++ b/3.8/slim-bookworm/Dockerfile @@ -75,7 +75,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,52 +123,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==57.5.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 57.5.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.8/slim-bullseye/Dockerfile b/3.8/slim-bullseye/Dockerfile index af6294985..0fbed7bde 100644 --- a/3.8/slim-bullseye/Dockerfile +++ b/3.8/slim-bullseye/Dockerfile @@ -75,7 +75,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -123,52 +123,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==57.5.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 57.5.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.9/alpine3.19/Dockerfile b/3.9/alpine3.19/Dockerfile index 196dc2edf..fd059f6f0 100644 --- a/3.9/alpine3.19/Dockerfile +++ b/3.9/alpine3.19/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -118,43 +118,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 58.1.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.9/alpine3.20/Dockerfile b/3.9/alpine3.20/Dockerfile index 67705b5e9..cd0ed7041 100644 --- a/3.9/alpine3.20/Dockerfile +++ b/3.9/alpine3.20/Dockerfile @@ -77,7 +77,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ # set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() @@ -118,43 +118,25 @@ RUN set -eux; \ ; \ apk del --no-network .build-deps; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 58.1.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.9/bookworm/Dockerfile b/3.9/bookworm/Dockerfile index 1a5737a8a..4a1466157 100644 --- a/3.9/bookworm/Dockerfile +++ b/3.9/bookworm/Dockerfile @@ -49,7 +49,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -88,43 +88,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 58.1.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile index 01a1da740..d0054defb 100644 --- a/3.9/bullseye/Dockerfile +++ b/3.9/bullseye/Dockerfile @@ -49,7 +49,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -88,43 +88,25 @@ RUN set -eux; \ \ ldconfig; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 58.1.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.9/slim-bookworm/Dockerfile b/3.9/slim-bookworm/Dockerfile index bccfb2f57..9588177f9 100644 --- a/3.9/slim-bookworm/Dockerfile +++ b/3.9/slim-bookworm/Dockerfile @@ -75,7 +75,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -122,52 +122,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 58.1.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/3.9/slim-bullseye/Dockerfile b/3.9/slim-bullseye/Dockerfile index 09ec5ca08..09512fbae 100644 --- a/3.9/slim-bullseye/Dockerfile +++ b/3.9/slim-bullseye/Dockerfile @@ -75,7 +75,7 @@ RUN set -eux; \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ @@ -122,52 +122,25 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + wheel \ + ; \ + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 23.0.1 -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION 58.1.0 -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py -ENV PYTHON_GET_PIP_SHA256 bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 939355f8b..bbfc48193 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -176,7 +176,7 @@ RUN set -eux; \ --with-lto \ {{ ) end -}} --with-system-expat \ - --without-ensurepip \ + --with-ensurepip \ ; \ nproc="$(nproc)"; \ {{ if is_alpine then ( -}} @@ -259,63 +259,27 @@ RUN set -eux; \ {{ ) else "" end -}} {{ ) end -}} \ - python3 --version + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ +{{ if .setuptools then ( -}} + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + {{ "setuptools==\( .setuptools.version )" | @sh }} \ + wheel \ + ; \ +{{ ) else "" end -}} + pip3 --version # make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends) RUN set -eux; \ - for src in idle3 pydoc3 python3 python3-config; do \ + for src in idle3 pip3 pydoc3 python3 python3-config; do \ dst="$(echo "$src" | tr -d 3)"; \ [ -s "/usr/local/bin/$src" ]; \ [ ! -e "/usr/local/bin/$dst" ]; \ ln -svT "$src" "/usr/local/bin/$dst"; \ done -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION {{ .pip.version }} -{{ if .setuptools then ( -}} -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION {{ .setuptools.version }} -{{ ) else "" end -}} -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL {{ ."get-pip".url }} -ENV PYTHON_GET_PIP_SHA256 {{ ."get-pip".sha256 }} - -RUN set -eux; \ - \ -{{ if is_slim then ( -}} - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends wget; \ - \ -{{ ) else "" end -}} - wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ - echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ - \ -{{ if is_slim then ( -}} - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ -{{ ) else "" end -}} - export PYTHONDONTWRITEBYTECODE=1; \ - \ - python get-pip.py \ - --disable-pip-version-check \ - --no-cache-dir \ - --no-compile \ - "pip==$PYTHON_PIP_VERSION" \ -{{ if .setuptools then ( -}} - "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change - wheel \ -{{ ) else ( -}} - --no-setuptools \ - --no-wheel \ -{{ ) end -}} - ; \ - rm -f get-pip.py; \ - \ - pip --version - CMD ["python3"] diff --git a/Dockerfile-windows.template b/Dockerfile-windows.template index da01b7033..78d5aaa9d 100644 --- a/Dockerfile-windows.template +++ b/Dockerfile-windows.template @@ -22,7 +22,7 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en 'PrependPath=1', \ 'Shortcuts=0', \ 'Include_doc=0', \ - 'Include_pip=0', \ + 'Include_pip=1', \ 'Include_test=0' \ ) \ ).ExitCode; \ @@ -42,45 +42,18 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en Remove-Item python.exe -Force; \ Remove-Item $env:TEMP/Python*.log -Force; \ \ - Write-Host 'Complete.' - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION {{ .pip.version }} -{{ if .setuptools then ( -}} -# https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION {{ .setuptools.version }} -{{ ) else "" end -}} -# https://github.com/pypa/get-pip -ENV PYTHON_GET_PIP_URL {{ ."get-pip".url }} -ENV PYTHON_GET_PIP_SHA256 {{ ."get-pip".sha256 }} - -RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ - if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ $env:PYTHONDONTWRITEBYTECODE = '1'; \ +{{ if .setuptools then ( -}} \ - Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - python get-pip.py \ + Write-Host ('Installing setuptools and wheel ...'); \ + pip install \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ - ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ -{{ if .setuptools then ( -}} - ('setuptools=={0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \ - # get-pip.py installs wheel by default, adding in case get-pip defaults change + 'setuptools=={{ .setuptools.version }}' \ wheel \ -{{ ) else ( -}} - --no-setuptools \ - --no-wheel \ -{{ ) end -}} ; \ - Remove-Item get-pip.py -Force; \ +{{ ) else "" end -}} \ Write-Host 'Verifying pip install ...'; \ pip --version; \ diff --git a/versions.json b/versions.json index 410dc3fe0..42441133d 100644 --- a/versions.json +++ b/versions.json @@ -1,13 +1,5 @@ { "3.10": { - "get-pip": { - "sha256": "bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", - "url": "https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", - "version": "https://github.com/pypa/get-pip/commit/def4aec84b261b939137dd1c69eff0aabb4a7bf4" - }, - "pip": { - "version": "23.0.1" - }, "setuptools": { "version": "65.5.1" }, @@ -22,14 +14,6 @@ "version": "3.10.14" }, "3.11": { - "get-pip": { - "sha256": "bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", - "url": "https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", - "version": "https://github.com/pypa/get-pip/commit/def4aec84b261b939137dd1c69eff0aabb4a7bf4" - }, - "pip": { - "version": "24.0" - }, "setuptools": { "version": "65.5.1" }, @@ -46,14 +30,6 @@ "version": "3.11.9" }, "3.12": { - "get-pip": { - "sha256": "bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", - "url": "https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", - "version": "https://github.com/pypa/get-pip/commit/def4aec84b261b939137dd1c69eff0aabb4a7bf4" - }, - "pip": { - "version": "24.2" - }, "variants": [ "bookworm", "slim-bookworm", @@ -67,14 +43,6 @@ "version": "3.12.5" }, "3.13-rc": { - "get-pip": { - "sha256": "bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", - "url": "https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", - "version": "https://github.com/pypa/get-pip/commit/def4aec84b261b939137dd1c69eff0aabb4a7bf4" - }, - "pip": { - "version": "24.1.1" - }, "variants": [ "bookworm", "slim-bookworm", @@ -88,14 +56,6 @@ "version": "3.13.0rc1" }, "3.8": { - "get-pip": { - "sha256": "bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", - "url": "https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", - "version": "https://github.com/pypa/get-pip/commit/def4aec84b261b939137dd1c69eff0aabb4a7bf4" - }, - "pip": { - "version": "23.0.1" - }, "setuptools": { "version": "57.5.0" }, @@ -110,14 +70,6 @@ "version": "3.8.19" }, "3.9": { - "get-pip": { - "sha256": "bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a", - "url": "https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py", - "version": "https://github.com/pypa/get-pip/commit/def4aec84b261b939137dd1c69eff0aabb4a7bf4" - }, - "pip": { - "version": "23.0.1" - }, "setuptools": { "version": "58.1.0" }, diff --git a/versions.sh b/versions.sh index ccd045303..e99d6679f 100755 --- a/versions.sh +++ b/versions.sh @@ -17,14 +17,6 @@ else fi versions=( "${versions[@]%/}" ) -getPipCommit="$( - wget -qO- --header 'Accept: application/json' 'https://github.com/pypa/get-pip/commits/main/public/get-pip.py.atom' \ - | jq -r '.payload | first(.commitGroups[].commits[].oid)' -)" -getPipUrl="https://github.com/pypa/get-pip/raw/$getPipCommit/public/get-pip.py" -getPipSha256="$(wget -qO- "$getPipUrl" | sha256sum | cut -d' ' -f1)" -export getPipCommit getPipUrl getPipSha256 - has_linux_version() { local dir="$1"; shift local dirVersion="$1"; shift @@ -126,16 +118,12 @@ for version in "${versions[@]}"; do wget -qO- "https://github.com/python/cpython/raw/v$fullVersion/Lib/ensurepip/__init__.py" \ | grep -E '^[^[:space:]]+_VERSION[[:space:]]*=' )" - pipVersion="$(sed -nre 's/^_PIP_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")" - if [ -z "$pipVersion" ]; then - echo >&2 "error: $version: missing pip version" - exit 1 - fi - if ! wget -q -O /dev/null -o /dev/null --spider "https://pypi.org/pypi/pip/$pipVersion/json"; then - echo >&2 "error: $version: pip version ($pipVersion) seems to be invalid?" - exit 1 - fi + # Note: We don't extract the pip version here, since our policy is now to use the pip version + # that is installed during the Python build (which is the version bundled in ensurepip), and + # to not support overriding it. + + # TODO remove setuptools version handling entirely once Python 3.11 is EOL setuptoolsVersion="$(sed -nre 's/^_SETUPTOOLS_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")" case "$rcVersion" in 3.8 | 3.9 | 3.10 | 3.11) @@ -171,22 +159,12 @@ for version in "${versions[@]}"; do ;; esac - # TODO wheelVersion, somehow: https://github.com/docker-library/python/issues/365#issuecomment-914669320 - - echo "$version: $fullVersion (pip $pipVersion${setuptoolsVersion:+, setuptools $setuptoolsVersion}${hasWindows:+, windows})" + echo "$version: $fullVersion" export fullVersion pipVersion setuptoolsVersion hasWindows json="$(jq <<<"$json" -c ' .[env.version] = { version: env.fullVersion, - pip: { - version: env.pipVersion, - }, - "get-pip": { - version: "https://github.com/pypa/get-pip/commit/\(env.getPipCommit)", - url: env.getPipUrl, - sha256: env.getPipSha256, - }, variants: [ ( "bookworm",