diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index c5343a58..eef8836b 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -19,10 +19,6 @@ jobs: with: base: ${{ github.ref }} filters: | - python/3.8/focal: 'python/3.8/focal/**' - python/3.8/slim-focal: 'python/3.8/slim-focal/**' - python/3.8/jammy: 'python/3.8/jammy/**' - python/3.8/slim-jammy: 'python/3.8/slim-jammy/**' python/3.9/focal: 'python/3.9/focal/**' python/3.9/slim-focal: 'python/3.9/slim-focal/**' python/3.9/jammy: 'python/3.9/jammy/**' diff --git a/python/3.8/focal/Containerfile b/python/3.8/focal/Containerfile deleted file mode 100644 index 3a0b2059..00000000 --- a/python/3.8/focal/Containerfile +++ /dev/null @@ -1,112 +0,0 @@ -# syntax=docker/dockerfile:1 -ARG BASE_IMAGE=docker.io/polymathrobotics/buildpack-deps:focal -# 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 E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.8.20 - -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"; \ - 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-system-expat \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - 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' \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - 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) -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"] \ No newline at end of file diff --git a/python/3.8/focal/docker-bake.hcl b/python/3.8/focal/docker-bake.hcl deleted file mode 100644 index 0bcf53c5..00000000 --- a/python/3.8/focal/docker-bake.hcl +++ /dev/null @@ -1,38 +0,0 @@ -variable "TAG_PREFIX" { - default = "docker.io/polymathrobotics/python" -} - -variable "VERSION" { - default = "3.8.20" -} - -# 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}-focal", - "${TAG_PREFIX}:${join(".", slice(split(".", "${VERSION}"), 0, 2))}-focal", - ] - 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"] -} \ No newline at end of file diff --git a/python/3.8/focal/test/controls/python.rb b/python/3.8/focal/test/controls/python.rb deleted file mode 100644 index 2077bd77..00000000 --- a/python/3.8/focal/test/controls/python.rb +++ /dev/null @@ -1,3 +0,0 @@ -describe command('python3') do - it { should exist } -end diff --git a/python/3.8/jammy/Containerfile b/python/3.8/jammy/Containerfile deleted file mode 100644 index b28c13a9..00000000 --- a/python/3.8/jammy/Containerfile +++ /dev/null @@ -1,112 +0,0 @@ -# syntax=docker/dockerfile:1 -ARG BASE_IMAGE=docker.io/polymathrobotics/buildpack-deps:jammy -# 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 E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.8.20 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# hadolint ignore=DL3003,DL3013 -RUN set -eux; \ - \ - curl -fsSL -o python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - 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-system-expat \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - 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' \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - 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) -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"] \ No newline at end of file diff --git a/python/3.8/jammy/docker-bake.hcl b/python/3.8/jammy/docker-bake.hcl deleted file mode 100644 index d0485a01..00000000 --- a/python/3.8/jammy/docker-bake.hcl +++ /dev/null @@ -1,38 +0,0 @@ -variable "TAG_PREFIX" { - default = "docker.io/polymathrobotics/python" -} - -variable "VERSION" { - default = "3.8.20" -} - -# 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}-jammy", - "${TAG_PREFIX}:${join(".", slice(split(".", "${VERSION}"), 0, 2))}-jammy", - ] - 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"] -} \ No newline at end of file diff --git a/python/3.8/jammy/test/controls/python.rb b/python/3.8/jammy/test/controls/python.rb deleted file mode 100644 index 2077bd77..00000000 --- a/python/3.8/jammy/test/controls/python.rb +++ /dev/null @@ -1,3 +0,0 @@ -describe command('python3') do - it { should exist } -end diff --git a/python/3.8/slim-focal/Containerfile b/python/3.8/slim-focal/Containerfile deleted file mode 100644 index 13705dd0..00000000 --- a/python/3.8/slim-focal/Containerfile +++ /dev/null @@ -1,146 +0,0 @@ -# syntax=docker/dockerfile:1 -ARG BASE_IMAGE=docker.io/ubuntu:focal-20240530 -# 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 \ - ca-certificates \ - netbase \ - tzdata \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.8.20 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# hadolint ignore=DL3003,DL3013,DL3047,SC2086 -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - dpkg-dev \ - gcc \ - gnupg \ - libbluetooth-dev \ - libbz2-dev \ - libc6-dev \ - libdb-dev \ - libexpat1-dev \ - libffi-dev \ - libgdbm-dev \ - liblzma-dev \ - libncursesw5-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tk-dev \ - uuid-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - wget -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-system-expat \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - python \ - ; \ - make install; \ - \ - 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' \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - 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) -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"] \ No newline at end of file diff --git a/python/3.8/slim-focal/docker-bake.hcl b/python/3.8/slim-focal/docker-bake.hcl deleted file mode 100644 index 0bcf53c5..00000000 --- a/python/3.8/slim-focal/docker-bake.hcl +++ /dev/null @@ -1,38 +0,0 @@ -variable "TAG_PREFIX" { - default = "docker.io/polymathrobotics/python" -} - -variable "VERSION" { - default = "3.8.20" -} - -# 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}-focal", - "${TAG_PREFIX}:${join(".", slice(split(".", "${VERSION}"), 0, 2))}-focal", - ] - 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"] -} \ No newline at end of file diff --git a/python/3.8/slim-focal/test/controls/python.rb b/python/3.8/slim-focal/test/controls/python.rb deleted file mode 100644 index 2077bd77..00000000 --- a/python/3.8/slim-focal/test/controls/python.rb +++ /dev/null @@ -1,3 +0,0 @@ -describe command('python3') do - it { should exist } -end diff --git a/python/3.8/slim-jammy/Containerfile b/python/3.8/slim-jammy/Containerfile deleted file mode 100644 index ca86ae5d..00000000 --- a/python/3.8/slim-jammy/Containerfile +++ /dev/null @@ -1,146 +0,0 @@ -# syntax=docker/dockerfile:1 -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 - -# 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 \ - ca-certificates \ - netbase \ - tzdata \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 -ENV PYTHON_VERSION 3.8.20 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# hadolint ignore=DL3003,DL3013,DL3047,SC2086 -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - dpkg-dev \ - gcc \ - gnupg \ - libbluetooth-dev \ - libbz2-dev \ - libc6-dev \ - libdb-dev \ - libexpat1-dev \ - libffi-dev \ - libgdbm-dev \ - liblzma-dev \ - libncursesw5-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tk-dev \ - uuid-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ; \ - \ - wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ - wget -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-system-expat \ - --with-ensurepip \ - ; \ - nproc="$(nproc)"; \ - EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ - LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ - LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ - make -j "$nproc" \ - "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \ - "LDFLAGS=${LDFLAGS:-}" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - ; \ -# 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'" \ - "PROFILE_TASK=${PROFILE_TASK:-}" \ - python \ - ; \ - make install; \ - \ - 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' \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + \ - ; \ - \ - ldconfig; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ - 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) -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"] \ No newline at end of file diff --git a/python/3.8/slim-jammy/docker-bake.hcl b/python/3.8/slim-jammy/docker-bake.hcl deleted file mode 100644 index 7941316d..00000000 --- a/python/3.8/slim-jammy/docker-bake.hcl +++ /dev/null @@ -1,38 +0,0 @@ -variable "TAG_PREFIX" { - default = "docker.io/polymathrobotics/python" -} - -variable "VERSION" { - default = "3.8.20" -} - -# 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}-slim-jammy", - "${TAG_PREFIX}:${join(".", slice(split(".", "${VERSION}"), 0, 2))}-slim-jammy", - ] - 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"] -} \ No newline at end of file diff --git a/python/3.8/slim-jammy/test/controls/python.rb b/python/3.8/slim-jammy/test/controls/python.rb deleted file mode 100644 index 2077bd77..00000000 --- a/python/3.8/slim-jammy/test/controls/python.rb +++ /dev/null @@ -1,3 +0,0 @@ -describe command('python3') do - it { should exist } -end