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 e47cd1f commit 12a3433
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 34 deletions.
48 changes: 15 additions & 33 deletions python/3.8/jammy/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ 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 +21,7 @@ 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

# hadolint ignore=DL3003,DL3047
RUN set -eux; \
Expand Down Expand Up @@ -85,7 +86,17 @@ 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)
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand All @@ -97,33 +108,4 @@ RUN set -eux; \
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/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"]
2 changes: 1 addition & 1 deletion python/3.8/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.8.19"
default = "3.8.20"
}

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

0 comments on commit 12a3433

Please sign in to comment.