Skip to content

Commit

Permalink
Bump python to 3.12.6
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Sep 22, 2024
1 parent edb6628 commit a88cec5
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 156 deletions.
44 changes: 11 additions & 33 deletions python/3.12/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,7 +22,7 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305
ENV PYTHON_VERSION 3.12.5
ENV PYTHON_VERSION 3.12.6

# hadolint ignore=DL3003,DL3047
RUN set -eux; \
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,42 +87,18 @@ 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)
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.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

# 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" \
--no-setuptools \
--no-wheel \
; \
rm -f get-pip.py; \
\
pip --version

CMD ["python3"]
CMD ["python3"]
2 changes: 1 addition & 1 deletion python/3.12/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.12.5"
default = "3.12.6"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
44 changes: 11 additions & 33 deletions python/3.12/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,7 +22,7 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305
ENV PYTHON_VERSION 3.12.5
ENV PYTHON_VERSION 3.12.6

# hadolint ignore=DL3003,DL3047
RUN set -eux; \
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,42 +87,18 @@ 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)
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.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

# 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" \
--no-setuptools \
--no-wheel \
; \
rm -f get-pip.py; \
\
pip --version

CMD ["python3"]
CMD ["python3"]
2 changes: 1 addition & 1 deletion python/3.12/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.12.5"
default = "3.12.6"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
56 changes: 12 additions & 44 deletions python/3.12/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,7 +22,7 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305
ENV PYTHON_VERSION 3.12.5
ENV PYTHON_VERSION 3.12.6

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3047,SC2086
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,52 +122,18 @@ 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)
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.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

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" \
--no-setuptools \
--no-wheel \
; \
rm -f get-pip.py; \
\
pip --version

CMD ["python3"]
CMD ["python3"]
2 changes: 1 addition & 1 deletion python/3.12/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.12.5"
default = "3.12.6"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
53 changes: 11 additions & 42 deletions python/3.12/slim-noble/Containerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1
ARG CONTAINER_REGISTRY=docker.io
FROM $CONTAINER_REGISTRY/ubuntu:noble-20240605
FROM $CONTAINER_REGISTRY/ubuntu:noble-20240827.1

# 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,7 +21,7 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305
ENV PYTHON_VERSION 3.12.4
ENV PYTHON_VERSION 3.12.6

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3047,SC2086
Expand Down Expand Up @@ -73,7 +74,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,50 +121,18 @@ 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)
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/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

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" \
; \
rm -f get-pip.py; \
\
pip --version

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

variable "VERSION" {
default = "3.12.4"
default = "3.12.6"
}

variable "CONTAINER_REGISTRY" {
Expand Down

0 comments on commit a88cec5

Please sign in to comment.