Skip to content

Commit

Permalink
Bump python to 3.11.10
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Sep 22, 2024
1 parent 8371a26 commit edb6628
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 171 deletions.
57 changes: 20 additions & 37 deletions python/3.11/jammy/Containerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=docker.io/boxcutter/buildpack-deps:jammy
# hadolint ignore=DL3006
FROM $BASE_IMAGE

# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH

# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed
# last attempted removal of LANG broke many users:
# https://github.com/docker-library/python/pull/570
ENV LANG C.UTF-8

# runtime dependencies
Expand All @@ -20,9 +22,9 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.11.9
ENV PYTHON_VERSION 3.11.10

# hadolint ignore=DL3003,DL3047
# hadolint ignore=DL3003,DL3013,DL3047
RUN set -eux; \
\
wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \
Expand All @@ -46,7 +48,7 @@ RUN set -eux; \
--enable-shared \
--with-lto \
--with-system-expat \
--without-ensurepip \
--with-ensurepip \
; \
nproc="$(nproc)"; \
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \
Expand Down Expand Up @@ -85,45 +87,26 @@ 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)
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
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 '<VERSION>'"
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

# hadolint ignore=DL3047
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"]
CMD ["python3"]
2 changes: 1 addition & 1 deletion python/3.11/jammy/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "TAG_PREFIX" {
}

variable "VERSION" {
default = "3.11.9"
default = "3.11.10"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
55 changes: 20 additions & 35 deletions python/3.11/noble/Containerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=docker.io/boxcutter/buildpack-deps:noble
# hadolint ignore=DL3006
FROM $BASE_IMAGE

# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH

# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed
# last attempted removal of LANG broke many users:
# https://github.com/docker-library/python/pull/570
ENV LANG C.UTF-8

# runtime dependencies
Expand All @@ -20,9 +22,9 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.11.9
ENV PYTHON_VERSION 3.11.10

# hadolint ignore=DL3003,DL3047
# hadolint ignore=DL3003,DL3013,DL3047
RUN set -eux; \
\
wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \
Expand All @@ -46,7 +48,7 @@ RUN set -eux; \
--enable-shared \
--with-lto \
--with-system-expat \
--without-ensurepip \
--with-ensurepip \
; \
nproc="$(nproc)"; \
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \
Expand Down Expand Up @@ -85,43 +87,26 @@ 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)
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
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 '<VERSION>'"
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/e03e1607ad60522cf34a92e834138eb89f57667c/public/get-pip.py
ENV PYTHON_GET_PIP_SHA256 ee09098395e42eb1f82ef4acb231a767a6ae85504a9cf9983223df0a7cbd35d7

# hadolint ignore=DL3047
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" \
; \
rm -f get-pip.py; \
\
pip --version

CMD ["python3"]
CMD ["python3"]
2 changes: 1 addition & 1 deletion python/3.11/noble/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "TAG_PREFIX" {
}

variable "VERSION" {
default = "3.11.9"
default = "3.11.10"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
70 changes: 21 additions & 49 deletions python/3.11/slim-jammy/Containerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=docker.io/ubuntu:jammy-20240808
ARG BASE_IMAGE=docker.io/ubuntu:jammy-20240911.1
# hadolint ignore=DL3006
FROM $BASE_IMAGE

# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH

# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
# cannot remove LANG even though https://bugs.python.org/issue19846 is fixed
# last attempted removal of LANG broke many users:
# https://github.com/docker-library/python/pull/570
ENV LANG C.UTF-8

# runtime dependencies
Expand All @@ -20,10 +22,10 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.11.9
ENV PYTHON_VERSION 3.11.10

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3047,SC2086
# hadolint ignore=DL3003,DL3013,DL3047,SC2086
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
Expand Down Expand Up @@ -73,7 +75,7 @@ RUN set -eux; \
--enable-shared \
--with-lto \
--with-system-expat \
--without-ensurepip \
--with-ensurepip \
; \
nproc="$(nproc)"; \
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \
Expand Down Expand Up @@ -120,56 +122,26 @@ 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)
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
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 '<VERSION>'"
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

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3047,SC2086
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"]
CMD ["python3"]
2 changes: 1 addition & 1 deletion python/3.11/slim-jammy/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "TAG_PREFIX" {
}

variable "VERSION" {
default = "3.11.9"
default = "3.11.10"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
Loading

0 comments on commit edb6628

Please sign in to comment.