Skip to content

Commit

Permalink
Bump python to 3.8.20
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Sep 22, 2024
1 parent 9a65be5 commit b9ad3bc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 48 deletions.
68 changes: 21 additions & 47 deletions python/3.8/slim-noble/Containerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# syntax=docker/dockerfile:1
ARG CONTAINER_REGISTRY=docker.io
FROM $CONTAINER_REGISTRY/ubuntu:noble-20240605
# hadolint ignore=DL3006
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,10 +22,10 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568
ENV PYTHON_VERSION 3.8.19
ENV PYTHON_VERSION 3.8.20

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 @@ -72,7 +74,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)"; \
Expand Down Expand Up @@ -120,53 +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==57.5.0' \
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 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/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" \
"setuptools==$PYTHON_SETUPTOOLS_VERSION" \
; \
rm -f get-pip.py; \
\
pip --version

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

variable "CONTAINER_REGISTRY" {
Expand Down

0 comments on commit b9ad3bc

Please sign in to comment.