Skip to content

Commit

Permalink
Bump python 3.10 to 3.10.16
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Dec 31, 2024
1 parent 6ee3825 commit 6718865
Show file tree
Hide file tree
Showing 13 changed files with 361 additions and 27 deletions.
10 changes: 5 additions & 5 deletions python/3.10/focal/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ARG BASE_IMAGE=docker.io/polymathrobotics/buildpack-deps:focal
FROM $BASE_IMAGE

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

# 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
ENV LANG=C.UTF-8

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

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.10.15
ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79
ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION=3.10.16
ENV PYTHON_SHA256=bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3013,SC2015
Expand Down
2 changes: 1 addition & 1 deletion python/3.10/focal/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.10.15"
default = "3.10.16"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
10 changes: 5 additions & 5 deletions python/3.10/jammy/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ARG BASE_IMAGE=docker.io/polymathrobotics/buildpack-deps:jammy
FROM $BASE_IMAGE

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

# 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
ENV LANG=C.UTF-8

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

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.10.15
ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79
ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION=3.10.16
ENV PYTHON_SHA256=bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3013,SC2015
Expand Down
2 changes: 1 addition & 1 deletion python/3.10/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.10.15"
default = "3.10.16"
}

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

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

# 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
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libbluetooth-dev \
tk-dev \
uuid-dev \
; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION=3.10.16
ENV PYTHON_SHA256=bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3013,SC2015
RUN set -eux; \
\
curl -fsSL -o python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \
echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \
curl -fsSL -o python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; \
GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; \
gpg --batch --verify python.tar.xz.asc python.tar.xz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" python.tar.xz.asc; \
mkdir -p /usr/src/python; \
tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \
rm python.tar.xz; \
\
cd /usr/src/python; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--build="$gnuArch" \
--enable-loadable-sqlite-extensions \
--enable-optimizations \
--enable-option-checking=fatal \
--enable-shared \
--with-lto \
--with-ensurepip \
; \
nproc="$(nproc)"; \
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \
LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \
make -j "$nproc" \
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
"LDFLAGS=${LDFLAGS:-}" \
; \
# https://github.com/docker-library/python/issues/784
# prevent accidental usage of a system installed libpython of the same version
rm python; \
make -j "$nproc" \
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \
python \
; \
make install; \
\
# enable GDB to load debugging data: https://github.com/docker-library/python/pull/701
bin="$(readlink -ve /usr/local/bin/python3)"; \
dir="$(dirname "$bin")"; \
mkdir -p "/usr/share/gdb/auto-load/$dir"; \
cp -vL Tools/gdb/libpython.py "/usr/share/gdb/auto-load/$bin-gdb.py"; \
\
cd /; \
rm -rf /usr/src/python; \
\
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \
\) -exec rm -rf '{}' + \
; \
\
ldconfig; \
\
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 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

CMD ["python3"]
38 changes: 38 additions & 0 deletions python/3.10/noble/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
variable "TAG_PREFIX" {
default = "docker.io/polymathrobotics/python"
}

variable "VERSION" {
default = "3.10.16"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
variable "LOCAL_PLATFORM" {
default = regex_replace("${BAKE_LOCAL_PLATFORM}", "^(darwin)", "linux")
}

target "_common" {
dockerfile = "Containerfile"
tags = [
"${TAG_PREFIX}:${VERSION}-noble",
"${TAG_PREFIX}:${join(".", slice(split(".", "${VERSION}"), 0, 2))}-noble",
]
labels = {
"org.opencontainers.image.source" = "https://github.com/polymathrobotics/oci"
"org.opencontainers.image.licenses" = "Apache-2.0"
"org.opencontainers.image.description" = "Python is an interpreted, interactive, object-oriented, open-source programming language."
"org.opencontainers.image.title" = "${TAG_PREFIX}"
"org.opencontainers.image.created" = "${timestamp()}"
"dev.polymathrobotics.image.readme-filepath" = "python/README.md"
}
}

target "local" {
inherits = ["_common"]
platforms = ["${LOCAL_PLATFORM}"]
}

target "default" {
inherits = ["_common"]
platforms = ["linux/amd64", "linux/arm64/v8"]
}
3 changes: 3 additions & 0 deletions python/3.10/noble/test/controls/python.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
describe command('python3') do
it { should exist }
end
12 changes: 6 additions & 6 deletions python/3.10/slim-focal/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ ARG BASE_IMAGE=docker.io/ubuntu:focal-20241011
FROM $BASE_IMAGE

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

# 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
ENV LANG=C.UTF-8

# runtime dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
tzdata \
; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.10.15
ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79
ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION=3.10.16
ENV PYTHON_SHA256=bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3013,DL3047,SC2086
Expand Down
4 changes: 2 additions & 2 deletions python/3.10/slim-focal/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
variable "TAG_PREFIX" {
default = "docker.io/polymathrobotics/python"
default = "docker.io/polymathrobotics/python"
}

variable "VERSION" {
default = "3.10.15"
default = "3.10.16"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
Expand Down
12 changes: 6 additions & 6 deletions python/3.10/slim-jammy/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ ARG BASE_IMAGE=docker.io/ubuntu:jammy-20240911.1
FROM $BASE_IMAGE

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

# 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
ENV LANG=C.UTF-8

# runtime dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
tzdata \
; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.10.15
ENV PYTHON_SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79
ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION=3.10.16
ENV PYTHON_SHA256=bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,DL3013,DL3047,SC2086
Expand Down
2 changes: 1 addition & 1 deletion python/3.10/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.10.15"
default = "3.10.16"
}

# 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 6718865

Please sign in to comment.