diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d046483eb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +/*/**/Dockerfile linguist-generated +/Dockerfile*.template linguist-language=Dockerfile +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..de3a60907 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: GitHub CI + +on: + pull_request: + push: + workflow_dispatch: + schedule: + - cron: 0 0 * * 0 + +defaults: + run: + shell: 'bash -Eeuo pipefail -x {0}' + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + + generate-jobs: + name: Generate Jobs + runs-on: ubuntu-latest + outputs: + strategy: ${{ steps.generate-jobs.outputs.strategy }} + steps: + - uses: actions/checkout@v4 + - uses: docker-library/bashbrew@HEAD + - id: generate-jobs + name: Generate Jobs + run: | + strategy="$("$BASHBREW_SCRIPTS/github-actions/generate.sh")" + + # https://github.com/docker-library/python/pull/706 (ensure we don't have any unexpected ".a" leftovers in "/usr/local") + strategy="$(jq <<<"$strategy" -c ' + .matrix.include |= map( + if .os == "ubuntu-latest" then + .runs.test += "\n" + ( + .meta.entries + | map( + .tags[0] + | "aFiles=\"$(docker run --rm \(. | @sh) find /usr/local -name \"*.a\" | tee /dev/stderr)\"; [ -z \"$aFiles\" ]" + ) + | join("\n") + ) + else . end + ) + ')" + + EOF="EOF-$RANDOM-$RANDOM-$RANDOM" + echo "strategy<<$EOF" >> "$GITHUB_OUTPUT" + jq <<<"$strategy" . | tee -a "$GITHUB_OUTPUT" + echo "$EOF" >> "$GITHUB_OUTPUT" + + test: + needs: generate-jobs + strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Prepare Environment + run: ${{ matrix.runs.prepare }} + - name: Pull Dependencies + run: ${{ matrix.runs.pull }} + - name: Build ${{ matrix.name }} + run: ${{ matrix.runs.build }} + - name: History ${{ matrix.name }} + run: ${{ matrix.runs.history }} + - name: Test ${{ matrix.name }} + run: ${{ matrix.runs.test }} + - name: '"docker images"' + run: ${{ matrix.runs.images }} diff --git a/.github/workflows/verify-templating.yml b/.github/workflows/verify-templating.yml new file mode 100644 index 000000000..e822ba6bb --- /dev/null +++ b/.github/workflows/verify-templating.yml @@ -0,0 +1,19 @@ +name: Verify Templating + +on: + pull_request: + push: + workflow_dispatch: + +defaults: + run: + shell: 'bash -Eeuo pipefail -x {0}' + +jobs: + apply-templates: + name: Check For Uncomitted Changes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: ./apply-templates.sh + - run: git diff --exit-code diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..d548f66de --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.jq-template.awk diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 24b2e11b1..000000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: bash -services: docker - -env: - - VERSION=3.6 VARIANT= - - VERSION=3.6 VARIANT=slim - - VERSION=3.6 VARIANT=alpine - - VERSION=3.5 VARIANT= - - VERSION=3.5 VARIANT=slim - - VERSION=3.5 VARIANT=alpine - - VERSION=3.4 VARIANT= - - VERSION=3.4 VARIANT=slim - - VERSION=3.4 VARIANT=alpine - - VERSION=3.4 VARIANT=wheezy - - VERSION=3.3 VARIANT= - - VERSION=3.3 VARIANT=slim - - VERSION=3.3 VARIANT=alpine - - VERSION=3.3 VARIANT=wheezy - - VERSION=2.7 VARIANT= - - VERSION=2.7 VARIANT=slim - - VERSION=2.7 VARIANT=alpine - - VERSION=2.7 VARIANT=wheezy - -install: - - git clone https://github.com/docker-library/official-images.git ~/official-images - -before_script: - - env | sort - - cd "$VERSION" - - image="$(awk '$1 == "FROM" { print $2; exit }' onbuild/Dockerfile)${VARIANT:+-$VARIANT}" - -script: - - docker build -t "$image" "${VARIANT:-.}" - - ~/official-images/test/run.sh "$image" -# the "onbuild" variant has to happen with the base variant because it's FROM it - - true && [ "$VARIANT" ] || docker build -t "${image}-onbuild" onbuild - -after_script: - - docker images - -# vim:set et ts=2 sw=2: diff --git a/2.7/Dockerfile b/2.7/Dockerfile deleted file mode 100644 index e56901f64..000000000 --- a/2.7/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -FROM buildpack-deps:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF -ENV PYTHON_VERSION 2.7.12 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-shared \ - --enable-unicode=ucs4 \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python2 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# install "virtualenv", since the vast majority of users of this image will want it -RUN pip install --no-cache-dir virtualenv - -CMD ["python2"] diff --git a/2.7/alpine/Dockerfile b/2.7/alpine/Dockerfile deleted file mode 100644 index 2c53d0cb1..000000000 --- a/2.7/alpine/Dockerfile +++ /dev/null @@ -1,92 +0,0 @@ -FROM alpine:3.4 - -# 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. -ENV LANG C.UTF-8 - -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - -ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF -ENV PYTHON_VERSION 2.7.12 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && apk add --no-cache --virtual .fetch-deps \ - gnupg \ - openssl \ - tar \ - xz \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && apk add --no-cache --virtual .build-deps \ - bzip2-dev \ - gcc \ - gdbm-dev \ - libc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - zlib-dev \ -# add build deps before removing fetch deps in case there's overlap - && apk del .fetch-deps \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-shared \ - --enable-unicode=ucs4 \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python2 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ - && apk del .build-deps \ - && rm -rf /usr/src/python ~/.cache - -CMD ["python2"] diff --git a/2.7/onbuild/Dockerfile b/2.7/onbuild/Dockerfile deleted file mode 100644 index 304d79a05..000000000 --- a/2.7/onbuild/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:2.7 - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/2.7/slim/Dockerfile b/2.7/slim/Dockerfile deleted file mode 100644 index 6e656bc22..000000000 --- a/2.7/slim/Dockerfile +++ /dev/null @@ -1,80 +0,0 @@ -FROM debian:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libsqlite3-0 \ - libssl1.0.0 \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF -ENV PYTHON_VERSION 2.7.12 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - gcc \ - libbz2-dev \ - libc6-dev \ - libdb-dev \ - libncurses-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tcl-dev \ - tk-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-shared \ - --enable-unicode=ucs4 \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python2 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -CMD ["python2"] diff --git a/2.7/wheezy/Dockerfile b/2.7/wheezy/Dockerfile deleted file mode 100644 index 6c3b68436..000000000 --- a/2.7/wheezy/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -FROM buildpack-deps:wheezy - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF -ENV PYTHON_VERSION 2.7.12 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-shared \ - --enable-unicode=ucs4 \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python2 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# install "virtualenv", since the vast majority of users of this image will want it -RUN pip install --no-cache-dir virtualenv - -CMD ["python2"] diff --git a/2.7/windows/windowsservercore/Dockerfile b/2.7/windows/windowsservercore/Dockerfile deleted file mode 100644 index 901c8137a..000000000 --- a/2.7/windows/windowsservercore/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -FROM microsoft/windowsservercore - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] - -ENV PYTHON_VERSION 2.7.12 -ENV PYTHON_RELEASE 2.7.12 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ - Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.msi'); \ - \ - Write-Host 'Installing ...'; \ -# https://www.python.org/download/releases/2.4/msi/ - Start-Process msiexec -Wait \ - -ArgumentList @( \ - '/i', \ - 'python.msi', \ - '/quiet', \ - '/qn', \ - 'TARGETDIR=C:\Python', \ - 'ALLUSERS=1', \ - 'ADDLOCAL=DefaultFeature,Extensions,TclTk,Tools,PrependPath' \ - ); \ - \ -# the installer updated PATH, so we should refresh our local value - $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item python.msi -Force; \ - \ - $pipInstall = ('pip=={0}' -f $env:PYTHON_PIP_VERSION); \ - Write-Host ('Installing {0} ...' -f $pipInstall); \ - (New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \ - python get-pip.py $pipInstall; \ - Remove-Item get-pip.py -Force; \ - \ - Write-Host 'Verifying pip install ...'; \ - pip --version; \ - \ - Write-Host 'Complete.'; - -# install "virtualenv", since the vast majority of users of this image will want it -RUN pip install --no-cache-dir virtualenv - -CMD ["python"] diff --git a/3.10/alpine3.20/Dockerfile b/3.10/alpine3.20/Dockerfile new file mode 100644 index 000000000..0fed3b855 --- /dev/null +++ b/3.10/alpine3.20/Dockerfile @@ -0,0 +1,141 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.10.17 +ENV PYTHON_SHA256 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.10/alpine3.21/Dockerfile b/3.10/alpine3.21/Dockerfile new file mode 100644 index 000000000..bde84e689 --- /dev/null +++ b/3.10/alpine3.21/Dockerfile @@ -0,0 +1,141 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.10.17 +ENV PYTHON_SHA256 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.10/bookworm/Dockerfile b/3.10/bookworm/Dockerfile new file mode 100644 index 000000000..365c28eb3 --- /dev/null +++ b/3.10/bookworm/Dockerfile @@ -0,0 +1,113 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm + +# 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.17 +ENV PYTHON_SHA256 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--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' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile new file mode 100644 index 000000000..df9e90582 --- /dev/null +++ b/3.10/bullseye/Dockerfile @@ -0,0 +1,113 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye + +# 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.17 +ENV PYTHON_SHA256 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--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' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.10/slim-bookworm/Dockerfile b/3.10/slim-bookworm/Dockerfile new file mode 100644 index 000000000..28ea16618 --- /dev/null +++ b/3.10/slim-bookworm/Dockerfile @@ -0,0 +1,146 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# 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 A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.10.17 +ENV PYTHON_SHA256 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --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:-}" \ + ; \ +# 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; \ + \ + 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; \ + \ + 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==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.10/slim-bullseye/Dockerfile b/3.10/slim-bullseye/Dockerfile new file mode 100644 index 000000000..a8758f729 --- /dev/null +++ b/3.10/slim-bullseye/Dockerfile @@ -0,0 +1,146 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +# 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 A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.10.17 +ENV PYTHON_SHA256 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --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:-}" \ + ; \ +# 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; \ + \ + 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; \ + \ + 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==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.11/alpine3.20/Dockerfile b/3.11/alpine3.20/Dockerfile new file mode 100644 index 000000000..5d5a0be1a --- /dev/null +++ b/3.11/alpine3.20/Dockerfile @@ -0,0 +1,141 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.11.12 +ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.11/alpine3.21/Dockerfile b/3.11/alpine3.21/Dockerfile new file mode 100644 index 000000000..78e40d489 --- /dev/null +++ b/3.11/alpine3.21/Dockerfile @@ -0,0 +1,141 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.11.12 +ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.11/bookworm/Dockerfile b/3.11/bookworm/Dockerfile new file mode 100644 index 000000000..f6a7a9a40 --- /dev/null +++ b/3.11/bookworm/Dockerfile @@ -0,0 +1,113 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm + +# 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.11.12 +ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--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' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.11/bullseye/Dockerfile b/3.11/bullseye/Dockerfile new file mode 100644 index 000000000..4b7d3f217 --- /dev/null +++ b/3.11/bullseye/Dockerfile @@ -0,0 +1,113 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye + +# 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.11.12 +ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--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' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.11/slim-bookworm/Dockerfile b/3.11/slim-bookworm/Dockerfile new file mode 100644 index 000000000..3634bae14 --- /dev/null +++ b/3.11/slim-bookworm/Dockerfile @@ -0,0 +1,146 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# 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 A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.11.12 +ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --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:-}" \ + ; \ +# 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; \ + \ + 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; \ + \ + 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==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.11/slim-bullseye/Dockerfile b/3.11/slim-bullseye/Dockerfile new file mode 100644 index 000000000..e89207c9d --- /dev/null +++ b/3.11/slim-bullseye/Dockerfile @@ -0,0 +1,146 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +# 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 A035C8C19219BA821ECEA86B64E628F8D684696D +ENV PYTHON_VERSION 3.11.12 +ENV PYTHON_SHA256 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --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:-}" \ + ; \ +# 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; \ + \ + 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; \ + \ + 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==65.5.1' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.12/alpine3.20/Dockerfile b/3.12/alpine3.20/Dockerfile new file mode 100644 index 000000000..9519e47a9 --- /dev/null +++ b/3.12/alpine3.20/Dockerfile @@ -0,0 +1,150 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + 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"] diff --git a/3.12/alpine3.21/Dockerfile b/3.12/alpine3.21/Dockerfile new file mode 100644 index 000000000..9b2b2fe71 --- /dev/null +++ b/3.12/alpine3.21/Dockerfile @@ -0,0 +1,150 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + 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"] diff --git a/3.12/bookworm/Dockerfile b/3.12/bookworm/Dockerfile new file mode 100644 index 000000000..3c5dadda8 --- /dev/null +++ b/3.12/bookworm/Dockerfile @@ -0,0 +1,122 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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 --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"] diff --git a/3.12/bullseye/Dockerfile b/3.12/bullseye/Dockerfile new file mode 100644 index 000000000..db27cbbe8 --- /dev/null +++ b/3.12/bullseye/Dockerfile @@ -0,0 +1,122 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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 --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"] diff --git a/3.12/slim-bookworm/Dockerfile b/3.12/slim-bookworm/Dockerfile new file mode 100644 index 000000000..f476f736a --- /dev/null +++ b/3.12/slim-bookworm/Dockerfile @@ -0,0 +1,155 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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; \ + \ + 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 --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"] diff --git a/3.12/slim-bullseye/Dockerfile b/3.12/slim-bullseye/Dockerfile new file mode 100644 index 000000000..1e5f18c20 --- /dev/null +++ b/3.12/slim-bullseye/Dockerfile @@ -0,0 +1,155 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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; \ + \ + 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 --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"] diff --git a/3.12/windows/windowsservercore-1809/Dockerfile b/3.12/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 000000000..aacfeb49e --- /dev/null +++ b/3.12/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 67b5635e80ea51072b87941312d00ec8927c4db9ba18938f7ad2d27b328b95fb + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.12/windows/windowsservercore-ltsc2022/Dockerfile b/3.12/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..f8f537a65 --- /dev/null +++ b/3.12/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 67b5635e80ea51072b87941312d00ec8927c4db9ba18938f7ad2d27b328b95fb + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.12/windows/windowsservercore-ltsc2025/Dockerfile b/3.12/windows/windowsservercore-ltsc2025/Dockerfile new file mode 100644 index 000000000..6e2a0d13f --- /dev/null +++ b/3.12/windows/windowsservercore-ltsc2025/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2025 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.12.10 +ENV PYTHON_SHA256 67b5635e80ea51072b87941312d00ec8927c4db9ba18938f7ad2d27b328b95fb + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.13/alpine3.20/Dockerfile b/3.13/alpine3.20/Dockerfile new file mode 100644 index 000000000..c3b9eb310 --- /dev/null +++ b/3.13/alpine3.20/Dockerfile @@ -0,0 +1,145 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + 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"] diff --git a/3.13/alpine3.21/Dockerfile b/3.13/alpine3.21/Dockerfile new file mode 100644 index 000000000..c289fda11 --- /dev/null +++ b/3.13/alpine3.21/Dockerfile @@ -0,0 +1,145 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + 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"] diff --git a/3.13/bookworm/Dockerfile b/3.13/bookworm/Dockerfile new file mode 100644 index 000000000..4a3f8a2b1 --- /dev/null +++ b/3.13/bookworm/Dockerfile @@ -0,0 +1,117 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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 --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"] diff --git a/3.13/bullseye/Dockerfile b/3.13/bullseye/Dockerfile new file mode 100644 index 000000000..1267fa3e6 --- /dev/null +++ b/3.13/bullseye/Dockerfile @@ -0,0 +1,117 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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 --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"] diff --git a/3.13/slim-bookworm/Dockerfile b/3.13/slim-bookworm/Dockerfile new file mode 100644 index 000000000..15a408ab7 --- /dev/null +++ b/3.13/slim-bookworm/Dockerfile @@ -0,0 +1,150 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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; \ + \ + 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 --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"] diff --git a/3.13/slim-bullseye/Dockerfile b/3.13/slim-bullseye/Dockerfile new file mode 100644 index 000000000..09ba3b8c2 --- /dev/null +++ b/3.13/slim-bullseye/Dockerfile @@ -0,0 +1,150 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 7169605F62C751356D054A26A821E680E5FA6305 +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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; \ + \ + 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 --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"] diff --git a/3.13/windows/windowsservercore-1809/Dockerfile b/3.13/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 000000000..44eecbd41 --- /dev/null +++ b/3.13/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 698f2df46e1a3dd92f393458eea77bd94ef5ff21f0d5bf5cf676f3d28a9b4b6c + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.13/windows/windowsservercore-ltsc2022/Dockerfile b/3.13/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..fd81d6410 --- /dev/null +++ b/3.13/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 698f2df46e1a3dd92f393458eea77bd94ef5ff21f0d5bf5cf676f3d28a9b4b6c + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.13/windows/windowsservercore-ltsc2025/Dockerfile b/3.13/windows/windowsservercore-ltsc2025/Dockerfile new file mode 100644 index 000000000..2f1c1813c --- /dev/null +++ b/3.13/windows/windowsservercore-ltsc2025/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2025 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.13.3 +ENV PYTHON_SHA256 698f2df46e1a3dd92f393458eea77bd94ef5ff21f0d5bf5cf676f3d28a9b4b6c + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.14-rc/alpine3.20/Dockerfile b/3.14-rc/alpine3.20/Dockerfile new file mode 100644 index 000000000..832c5e59b --- /dev/null +++ b/3.14-rc/alpine3.20/Dockerfile @@ -0,0 +1,138 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + 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"] diff --git a/3.14-rc/alpine3.21/Dockerfile b/3.14-rc/alpine3.21/Dockerfile new file mode 100644 index 000000000..39b392e95 --- /dev/null +++ b/3.14-rc/alpine3.21/Dockerfile @@ -0,0 +1,138 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(apk --print-arch)"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + x86_64|aarch64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + x86) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + 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"] diff --git a/3.14-rc/bookworm/Dockerfile b/3.14-rc/bookworm/Dockerfile new file mode 100644 index 000000000..b6b99382a --- /dev/null +++ b/3.14-rc/bookworm/Dockerfile @@ -0,0 +1,110 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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 --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"] diff --git a/3.14-rc/bullseye/Dockerfile b/3.14-rc/bullseye/Dockerfile new file mode 100644 index 000000000..34d0fc2a7 --- /dev/null +++ b/3.14-rc/bullseye/Dockerfile @@ -0,0 +1,110 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39 + +RUN set -eux; \ + \ + wget -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 -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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 --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"] diff --git a/3.14-rc/slim-bookworm/Dockerfile b/3.14-rc/slim-bookworm/Dockerfile new file mode 100644 index 000000000..ff44902a3 --- /dev/null +++ b/3.14-rc/slim-bookworm/Dockerfile @@ -0,0 +1,143 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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; \ + \ + 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 --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"] diff --git a/3.14-rc/slim-bullseye/Dockerfile b/3.14-rc/slim-bullseye/Dockerfile new file mode 100644 index 000000000..9cd8ab9de --- /dev/null +++ b/3.14-rc/slim-bullseye/Dockerfile @@ -0,0 +1,143 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39 + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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 \ + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ + amd64|arm64) \ + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ + i386) \ + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ + 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; \ + \ + 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; \ + \ + 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 --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"] diff --git a/3.14-rc/windows/windowsservercore-1809/Dockerfile b/3.14-rc/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 000000000..61a8ce521 --- /dev/null +++ b/3.14-rc/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,72 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 a878026c12b1a606d02f5bbf3ed65aa780ee8272964b8f95d8348ffa2d6ca096 + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Reinstalling pip to workaround a bug ...'; \ + # https://github.com/python/cpython/issues/133626 + # clean up broken pip install + Remove-Item -Recurse C:\Python\Lib\site-packages\pip*; \ + # install pip as pip.exe + python -m ensurepip --default-pip -vvv; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.14-rc/windows/windowsservercore-ltsc2022/Dockerfile b/3.14-rc/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..75ffda7b0 --- /dev/null +++ b/3.14-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,72 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 a878026c12b1a606d02f5bbf3ed65aa780ee8272964b8f95d8348ffa2d6ca096 + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Reinstalling pip to workaround a bug ...'; \ + # https://github.com/python/cpython/issues/133626 + # clean up broken pip install + Remove-Item -Recurse C:\Python\Lib\site-packages\pip*; \ + # install pip as pip.exe + python -m ensurepip --default-pip -vvv; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.14-rc/windows/windowsservercore-ltsc2025/Dockerfile b/3.14-rc/windows/windowsservercore-ltsc2025/Dockerfile new file mode 100644 index 000000000..ffc2b344d --- /dev/null +++ b/3.14-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -0,0 +1,72 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2025 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION 3.14.0b1 +ENV PYTHON_SHA256 a878026c12b1a606d02f5bbf3ed65aa780ee8272964b8f95d8348ffa2d6ca096 + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ + Write-Host 'Reinstalling pip to workaround a bug ...'; \ + # https://github.com/python/cpython/issues/133626 + # clean up broken pip install + Remove-Item -Recurse C:\Python\Lib\site-packages\pip*; \ + # install pip as pip.exe + python -m ensurepip --default-pip -vvv; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.3/Dockerfile b/3.3/Dockerfile deleted file mode 100644 index ee3062605..000000000 --- a/3.3/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 -ENV PYTHON_VERSION 3.3.6 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.3/alpine/Dockerfile b/3.3/alpine/Dockerfile deleted file mode 100644 index a4af10164..000000000 --- a/3.3/alpine/Dockerfile +++ /dev/null @@ -1,109 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.4 - -# 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. -ENV LANG C.UTF-8 - -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - -ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 -ENV PYTHON_VERSION 3.3.6 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && apk add --no-cache --virtual .fetch-deps \ - gnupg \ - openssl \ - tar \ - xz \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && apk add --no-cache --virtual .build-deps \ - bzip2-dev \ - gcc \ - libc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - xz-dev \ - zlib-dev \ -# add build deps before removing fetch deps in case there's overlap - && apk del .fetch-deps \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ - && apk del .build-deps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.3/onbuild/Dockerfile b/3.3/onbuild/Dockerfile deleted file mode 100644 index bc96d2fc7..000000000 --- a/3.3/onbuild/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM python:3.3 - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/3.3/slim/Dockerfile b/3.3/slim/Dockerfile deleted file mode 100644 index 847fc3c85..000000000 --- a/3.3/slim/Dockerfile +++ /dev/null @@ -1,97 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libsqlite3-0 \ - libssl1.0.0 \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 -ENV PYTHON_VERSION 3.3.6 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - gcc \ - libbz2-dev \ - libc6-dev \ - liblzma-dev \ - libncurses-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tcl-dev \ - tk-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.3/wheezy/Dockerfile b/3.3/wheezy/Dockerfile deleted file mode 100644 index 46980f537..000000000 --- a/3.3/wheezy/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:wheezy - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 -ENV PYTHON_VERSION 3.3.6 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.4/Dockerfile b/3.4/Dockerfile deleted file mode 100644 index 9fa0f7076..000000000 --- a/3.4/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.4.5 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.4/alpine/Dockerfile b/3.4/alpine/Dockerfile deleted file mode 100644 index b6c90b564..000000000 --- a/3.4/alpine/Dockerfile +++ /dev/null @@ -1,109 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.4 - -# 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. -ENV LANG C.UTF-8 - -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.4.5 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && apk add --no-cache --virtual .fetch-deps \ - gnupg \ - openssl \ - tar \ - xz \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && apk add --no-cache --virtual .build-deps \ - bzip2-dev \ - gcc \ - libc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - xz-dev \ - zlib-dev \ -# add build deps before removing fetch deps in case there's overlap - && apk del .fetch-deps \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ - && apk del .build-deps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.4/onbuild/Dockerfile b/3.4/onbuild/Dockerfile deleted file mode 100644 index 892c9c321..000000000 --- a/3.4/onbuild/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM python:3.4 - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/3.4/slim/Dockerfile b/3.4/slim/Dockerfile deleted file mode 100644 index 4ef2a4d96..000000000 --- a/3.4/slim/Dockerfile +++ /dev/null @@ -1,97 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libsqlite3-0 \ - libssl1.0.0 \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.4.5 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - gcc \ - libbz2-dev \ - libc6-dev \ - liblzma-dev \ - libncurses-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tcl-dev \ - tk-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile deleted file mode 100644 index 73d1c235d..000000000 --- a/3.4/wheezy/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:wheezy - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.4.5 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.5/Dockerfile b/3.5/Dockerfile deleted file mode 100644 index 69d91321e..000000000 --- a/3.5/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.5.2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.5/alpine/Dockerfile b/3.5/alpine/Dockerfile deleted file mode 100644 index bc2c41f2b..000000000 --- a/3.5/alpine/Dockerfile +++ /dev/null @@ -1,109 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.4 - -# 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. -ENV LANG C.UTF-8 - -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.5.2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && apk add --no-cache --virtual .fetch-deps \ - gnupg \ - openssl \ - tar \ - xz \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && apk add --no-cache --virtual .build-deps \ - bzip2-dev \ - gcc \ - libc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - xz-dev \ - zlib-dev \ -# add build deps before removing fetch deps in case there's overlap - && apk del .fetch-deps \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ - && apk del .build-deps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.5/onbuild/Dockerfile b/3.5/onbuild/Dockerfile deleted file mode 100644 index 45b1f2a39..000000000 --- a/3.5/onbuild/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM python:3.5 - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/3.5/slim/Dockerfile b/3.5/slim/Dockerfile deleted file mode 100644 index 111ff9711..000000000 --- a/3.5/slim/Dockerfile +++ /dev/null @@ -1,97 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libsqlite3-0 \ - libssl1.0.0 \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D -ENV PYTHON_VERSION 3.5.2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - gcc \ - libbz2-dev \ - libc6-dev \ - liblzma-dev \ - libncurses-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tcl-dev \ - tk-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.5/windows/windowsservercore/Dockerfile b/3.5/windows/windowsservercore/Dockerfile deleted file mode 100644 index 64c018734..000000000 --- a/3.5/windows/windowsservercore/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM microsoft/windowsservercore - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] - -ENV PYTHON_VERSION 3.5.2 -ENV PYTHON_RELEASE 3.5.2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ - Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ - \ - Write-Host 'Installing ...'; \ -# https://docs.python.org/3.5/using/windows.html#installing-without-ui - Start-Process python.exe -Wait \ - -ArgumentList @( \ - '/quiet', \ - 'InstallAllUsers=1', \ - 'TargetDir=C:\Python', \ - 'PrependPath=1', \ - 'Shortcuts=0', \ - 'Include_doc=0', \ - 'Include_test=0' \ - ); \ - \ -# the installer updated PATH, so we should refresh our local value - $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item python.exe -Force; \ - \ - $pipInstall = ('pip=={0}' -f $env:PYTHON_PIP_VERSION); \ - Write-Host ('Installing {0} ...' -f $pipInstall); \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - pip install --no-cache-dir --upgrade --force-reinstall $pipInstall; \ - \ - Write-Host 'Verifying pip install ...'; \ - pip --version; \ - \ - Write-Host 'Complete.'; - -CMD ["python"] diff --git a/3.6/Dockerfile b/3.6/Dockerfile deleted file mode 100644 index bc0af85b7..000000000 --- a/3.6/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM buildpack-deps:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D -ENV PYTHON_VERSION 3.6.0b2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.6/alpine/Dockerfile b/3.6/alpine/Dockerfile deleted file mode 100644 index 99e37bca5..000000000 --- a/3.6/alpine/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -FROM alpine:3.4 - -# 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. -ENV LANG C.UTF-8 - -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - -ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D -ENV PYTHON_VERSION 3.6.0b2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && apk add --no-cache --virtual .fetch-deps \ - gnupg \ - openssl \ - tar \ - xz \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && apk add --no-cache --virtual .build-deps \ - bzip2-dev \ - gcc \ - libc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - xz-dev \ - zlib-dev \ -# add build deps before removing fetch deps in case there's overlap - && apk del .fetch-deps \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ - && apk del .build-deps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.6/onbuild/Dockerfile b/3.6/onbuild/Dockerfile deleted file mode 100644 index 865aaa84c..000000000 --- a/3.6/onbuild/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.6 - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/3.6/slim/Dockerfile b/3.6/slim/Dockerfile deleted file mode 100644 index faf52981e..000000000 --- a/3.6/slim/Dockerfile +++ /dev/null @@ -1,91 +0,0 @@ -FROM debian:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libsqlite3-0 \ - libssl1.0.0 \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D -ENV PYTHON_VERSION 3.6.0b2 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN set -ex \ - && buildDeps=' \ - gcc \ - libbz2-dev \ - libc6-dev \ - liblzma-dev \ - libncurses-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tcl-dev \ - tk-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/3.6/windows/windowsservercore/Dockerfile b/3.6/windows/windowsservercore/Dockerfile deleted file mode 100644 index 771a30a82..000000000 --- a/3.6/windows/windowsservercore/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM microsoft/windowsservercore - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] - -ENV PYTHON_VERSION 3.6.0b2 -ENV PYTHON_RELEASE 3.6.0 - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 8.1.2 - -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ - Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ - \ - Write-Host 'Installing ...'; \ -# https://docs.python.org/3.5/using/windows.html#installing-without-ui - Start-Process python.exe -Wait \ - -ArgumentList @( \ - '/quiet', \ - 'InstallAllUsers=1', \ - 'TargetDir=C:\Python', \ - 'PrependPath=1', \ - 'Shortcuts=0', \ - 'Include_doc=0', \ - 'Include_test=0' \ - ); \ - \ -# the installer updated PATH, so we should refresh our local value - $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item python.exe -Force; \ - \ - $pipInstall = ('pip=={0}' -f $env:PYTHON_PIP_VERSION); \ - Write-Host ('Installing {0} ...' -f $pipInstall); \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - pip install --no-cache-dir --upgrade --force-reinstall $pipInstall; \ - \ - Write-Host 'Verifying pip install ...'; \ - pip --version; \ - \ - Write-Host 'Complete.'; - -CMD ["python"] diff --git a/3.9/alpine3.20/Dockerfile b/3.9/alpine3.20/Dockerfile new file mode 100644 index 000000000..35e8fef9c --- /dev/null +++ b/3.9/alpine3.20/Dockerfile @@ -0,0 +1,140 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 +ENV PYTHON_VERSION 3.9.22 +ENV PYTHON_SHA256 8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.9/alpine3.21/Dockerfile b/3.9/alpine3.21/Dockerfile new file mode 100644 index 000000000..a5f0d963f --- /dev/null +++ b/3.9/alpine3.21/Dockerfile @@ -0,0 +1,140 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +# 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; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; + +ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 +ENV PYTHON_VERSION 3.9.22 +ENV PYTHON_SHA256 8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec + +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ + wget -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 -; \ + 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-option-checking=fatal \ + --enable-shared \ + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ + 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; \ + \ + 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 '{}' + \ + ; \ + \ + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + 'setuptools==58.1.0' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.9/bookworm/Dockerfile b/3.9/bookworm/Dockerfile new file mode 100644 index 000000000..98de1f753 --- /dev/null +++ b/3.9/bookworm/Dockerfile @@ -0,0 +1,112 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm + +# 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.9.22 +ENV PYTHON_SHA256 8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec + +RUN set -eux; \ + \ + wget -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 -; \ + 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-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==58.1.0' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile new file mode 100644 index 000000000..afc057b96 --- /dev/null +++ b/3.9/bullseye/Dockerfile @@ -0,0 +1,112 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye + +# 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.9.22 +ENV PYTHON_SHA256 8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec + +RUN set -eux; \ + \ + wget -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 -; \ + 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-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==58.1.0' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.9/slim-bookworm/Dockerfile b/3.9/slim-bookworm/Dockerfile new file mode 100644 index 000000000..19b1b68ce --- /dev/null +++ b/3.9/slim-bookworm/Dockerfile @@ -0,0 +1,145 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# 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.9.22 +ENV PYTHON_SHA256 8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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-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:-}" \ + ; \ +# 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; \ + \ + 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; \ + \ + 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==58.1.0' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/3.9/slim-bullseye/Dockerfile b/3.9/slim-bullseye/Dockerfile new file mode 100644 index 000000000..ed73ba93a --- /dev/null +++ b/3.9/slim-bullseye/Dockerfile @@ -0,0 +1,145 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +# 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.9.22 +ENV PYTHON_SHA256 8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec + +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 \ + 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"; \ + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ + 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-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:-}" \ + ; \ +# 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; \ + \ + 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; \ + \ + 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==58.1.0' \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ + 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"] diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template deleted file mode 100644 index 5a9a60e07..000000000 --- a/Dockerfile-alpine.template +++ /dev/null @@ -1,103 +0,0 @@ -FROM alpine:3.4 - -# 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. -ENV LANG C.UTF-8 - -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - -ENV GPG_KEY %%PLACEHOLDER%% -ENV PYTHON_VERSION %%PLACEHOLDER%% - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% - -RUN set -ex \ - && apk add --no-cache --virtual .fetch-deps \ - gnupg \ - openssl \ - tar \ - xz \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && apk add --no-cache --virtual .build-deps \ - bzip2-dev \ - gcc \ - libc-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - pax-utils \ - readline-dev \ - sqlite-dev \ - tcl-dev \ - tk \ - tk-dev \ - xz-dev \ - zlib-dev \ -# add build deps before removing fetch deps in case there's overlap - && apk del .fetch-deps \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ - && apk del .build-deps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template deleted file mode 100644 index 56c6ef26d..000000000 --- a/Dockerfile-debian.template +++ /dev/null @@ -1,78 +0,0 @@ -FROM buildpack-deps:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY %%PLACEHOLDER%% -ENV PYTHON_VERSION %%PLACEHOLDER%% - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% - -RUN set -ex \ - && buildDeps=' \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template new file mode 100644 index 000000000..8b3b8c824 --- /dev/null +++ b/Dockerfile-linux.template @@ -0,0 +1,320 @@ +{{ + def is_alpine: + env.variant | startswith("alpine") + ; + def is_slim: + env.variant | startswith("slim-") + ; + def rcVersion: + env.version | rtrimstr("-rc") +-}} +{{ if is_alpine then ( -}} +FROM alpine:{{ env.variant | ltrimstr("alpine") }} +{{ ) elif is_slim then ( -}} +FROM debian:{{ env.variant | ltrimstr("slim-") }}-slim +{{ ) else ( -}} +FROM buildpack-deps:{{ env.variant }} +{{ ) end -}} + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +{{ if rcVersion | IN("3.9", "3.10", "3.11", "3.12") then ( -}} +{{ # only set LANG on versions less than 3.13 -}} +# 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 + +{{ ) else "" end -}} +# runtime dependencies +{{ if is_alpine then ( -}} +RUN set -eux; \ + apk add --no-cache \ + ca-certificates \ + tzdata \ + ; +{{ ) else ( -}} +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ +{{ if is_slim then ( -}} + ca-certificates \ + netbase \ + tzdata \ +{{ ) else ( -}} + libbluetooth-dev \ + tk-dev \ + uuid-dev \ +{{ ) end -}} + ; \ + rm -rf /var/lib/apt/lists/* +{{ ) end -}} + +{{ + def should_pgp: + # https://github.com/docker-library/python/issues/977 + # https://peps.python.org/pep-0761/ + # https://discuss.python.org/t/pep-761-deprecating-pgp-signatures-for-cpython-artifacts/67180 + rcVersion | IN("3.9", "3.10", "3.11", "3.12", "3.13") +-}} +{{ if should_pgp then ( -}} +ENV GPG_KEY {{ + { + # gpg: key B26995E310250568: public key "\xc5\x81ukasz Langa (GPG langa.pl) " imported + "3.9": "E3FF2839C048B25C084DEBE9B26995E310250568", + # https://peps.python.org/pep-0596/#release-manager-and-crew + + # gpg: key 64E628F8D684696D: public key "Pablo Galindo Salgado " imported + "3.10": "A035C8C19219BA821ECEA86B64E628F8D684696D", + # https://peps.python.org/pep-0619/#release-manager-and-crew + + # gpg: key 64E628F8D684696D: public key "Pablo Galindo Salgado " imported + "3.11": "A035C8C19219BA821ECEA86B64E628F8D684696D", + # https://peps.python.org/pep-0664/#release-manager-and-crew + + # gpg: key A821E680E5FA6305: public key "Thomas Wouters " imported + "3.12": "7169605F62C751356D054A26A821E680E5FA6305", + # https://peps.python.org/pep-0693/#release-manager-and-crew + + # gpg: key A821E680E5FA6305: public key "Thomas Wouters " imported + "3.13": "7169605F62C751356D054A26A821E680E5FA6305", + # https://peps.python.org/pep-0719/#release-manager-and-crew + }[rcVersion] +}} +{{ ) else "" end -}} +ENV PYTHON_VERSION {{ .version }} +{{ if .checksums.source.sha256 then ( -}} +ENV PYTHON_SHA256 {{ .checksums.source.sha256 }} +{{ ) else "" end -}} + +RUN set -eux; \ + \ +{{ if is_alpine then ( -}} + apk add --no-cache --virtual .build-deps \ + gnupg \ + tar \ + xz \ + \ + bluez-dev \ + bzip2-dev \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ + ; \ + \ +{{ ) elif is_slim then ( -}} + 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 \ + libffi-dev \ + libgdbm-dev \ + liblzma-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + make \ + tk-dev \ + uuid-dev \ + wget \ + xz-utils \ + zlib1g-dev \ + ; \ + \ +{{ ) else "" end -}} + wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \ +{{ if .checksums.source.sha256 then ( -}} + echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; \ +{{ ) else "" end -}} +{{ if should_pgp then ( -}} + 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; \ +{{ ) else "" end -}} + 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 \ +{{ + # https://github.com/docker-library/python/pull/980 (fixing PGO runs tests that fail, but shouldn't) + # https://github.com/python/cpython/issues/90548 (alpine failures; not likely to be fixed any time soon) + if is_alpine then "" else ( +-}} + --enable-optimizations \ +{{ ) end -}} + --enable-option-checking=fatal \ + --enable-shared \ +{{ + # <3.10 does not have -fno-semantic-interposition enabled and --with-lto does nothing for performance + # skip LTO on alpine on riscv64: https://github.com/docker-library/python/pull/935, https://github.com/docker-library/python/pull/1038 + if rcVersion == "3.9" then "" else ( +-}} + $(test "$gnuArch" != 'riscv64-linux-musl' && echo '--with-lto') \ +{{ ) end -}} + --with-ensurepip \ + ; \ + nproc="$(nproc)"; \ +{{ if is_alpine then ( -}} +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000"; \ +{{ ) else ( -}} + EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; \ + LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; \ +{{ ) end -}} +{{ if is_slim or is_alpine then ( -}} + LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \ +{{ ) else "" end -}} +{{ + # Enabling frame-pointers only makes sense for Python 3.12 and newer as those have perf profiler support + if rcVersion | IN("3.9", "3.10", "3.11") then "" else ( +-}} +{{ if is_alpine then ( -}} + arch="$(apk --print-arch)"; \ +{{ ) else ( -}} + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ +{{ ) end -}} +# https://docs.python.org/3.12/howto/perf_profiling.html +# https://github.com/docker-library/python/pull/1000#issuecomment-2597021615 + case "$arch" in \ +{{ if is_alpine then ( -}} + x86_64|aarch64) \ +{{ ) else ( -}} + amd64|arm64) \ +{{ ) end -}} + # only add "-mno-omit-leaf" on arches that support it + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html#index-momit-leaf-frame-pointer-2 + # https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html#index-momit-leaf-frame-pointer + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \ + ;; \ +{{ if is_alpine then ( -}} + x86) \ +{{ ) else ( -}} + i386) \ +{{ ) end -}} + # don't enable frame-pointers on 32bit x86 due to performance drop. + ;; \ + *) \ + # other arches don't support "-mno-omit-leaf" + EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; \ + ;; \ + esac; \ +{{ ) end -}} + 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; \ +{{ if is_alpine or is_slim then "" else ( -}} + \ +# 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"; \ +{{ ) end -}} + \ + 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 '{}' + \ + ; \ + \ +{{ if is_alpine then ( -}} + find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-network --virtual .python-rundeps \ + ; \ + apk del --no-network .build-deps; \ +{{ ) else ( -}} + ldconfig; \ +{{ if is_slim then ( -}} + \ + 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/*; \ +{{ ) else "" end -}} +{{ ) end -}} + \ + export PYTHONDONTWRITEBYTECODE=1; \ + python3 --version; \ +{{ if .setuptools then ( -}} + \ + pip3 install \ + --disable-pip-version-check \ + --no-cache-dir \ + --no-compile \ + {{ "setuptools==\( .setuptools.version )" | @sh }} \ + # https://github.com/docker-library/python/issues/1023 + 'wheel<0.46' \ + ; \ +{{ ) else "" end -}} + 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"] diff --git a/Dockerfile-onbuild.template b/Dockerfile-onbuild.template deleted file mode 100644 index 2950ec194..000000000 --- a/Dockerfile-onbuild.template +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:%%PLACEHOLDER%% - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template deleted file mode 100644 index 1eb9bb10c..000000000 --- a/Dockerfile-slim.template +++ /dev/null @@ -1,91 +0,0 @@ -FROM debian:jessie - -# 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. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libsqlite3-0 \ - libssl1.0.0 \ - && rm -rf /var/lib/apt/lists/* - -ENV GPG_KEY %%PLACEHOLDER%% -ENV PYTHON_VERSION %%PLACEHOLDER%% - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% - -RUN set -ex \ - && buildDeps=' \ - gcc \ - libbz2-dev \ - libc6-dev \ - liblzma-dev \ - libncurses-dev \ - libreadline-dev \ - libsqlite3-dev \ - libssl-dev \ - make \ - tcl-dev \ - tk-dev \ - wget \ - xz-utils \ - zlib1g-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - \ - && 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" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ - && gpg --batch --verify python.tar.xz.asc python.tar.xz \ - && rm -r "$GNUPGHOME" python.tar.xz.asc \ - && mkdir -p /usr/src/python \ - && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ - && rm python.tar.xz \ - \ - && cd /usr/src/python \ - && ./configure \ - --enable-loadable-sqlite-extensions \ - --enable-shared \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - \ -# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere - && if [ ! -e /usr/local/bin/pip3 ]; then : \ - && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ - && rm /tmp/get-pip.py \ - ; fi \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ -# then we use "pip list" to ensure we don't have more than one pip version installed -# https://github.com/docker-library/python/pull/100 - && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ - \ - && find /usr/local -depth \ - \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ - \) -exec rm -rf '{}' + \ - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python ~/.cache - -# make some useful symlinks that are expected to exist -RUN cd /usr/local/bin \ - && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ - && ln -s idle3 idle \ - && ln -s pydoc3 pydoc \ - && ln -s python3 python \ - && ln -s python3-config python-config - -CMD ["python3"] diff --git a/Dockerfile-windows.template b/Dockerfile-windows.template new file mode 100644 index 000000000..115b08c21 --- /dev/null +++ b/Dockerfile-windows.template @@ -0,0 +1,72 @@ +FROM mcr.microsoft.com/windows/{{ env.windowsVariant }}:{{ env.windowsRelease }} + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# https://github.com/docker-library/python/pull/557 +ENV PYTHONIOENCODING UTF-8 + +ENV PYTHON_VERSION {{ .version }} +{{ if .checksums.windows.sha256 then ( -}} +ENV PYTHON_SHA256 {{ .checksums.windows.sha256 }} +{{ ) else "" end -}} + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($env:PYTHON_VERSION -replace '[a-z]+[0-9]*$', ''), $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ +{{ if .checksums.windows.sha256 then ( -}} + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_SHA256); \ + if ((Get-FileHash python.exe -Algorithm sha256).Hash -ne $env:PYTHON_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ +{{ ) else "" end -}} + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3/using/windows.html#installing-without-ui + $exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=1', \ + 'Include_test=0' \ + ) \ + ).ExitCode; \ + if ($exitCode -ne 0) { \ + Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \ + Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \ + exit $exitCode; \ + } \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + Remove-Item $env:TEMP/Python*.log -Force; \ + \ + $env:PYTHONDONTWRITEBYTECODE = '1'; \ + \ +{{ if .version == "3.14.0b1" then ( -}} + Write-Host 'Reinstalling pip to workaround a bug ...'; \ + # https://github.com/python/cpython/issues/133626 + # clean up broken pip install + Remove-Item -Recurse C:\Python\Lib\site-packages\pip*; \ + # install pip as pip.exe + python -m ensurepip --default-pip -vvv; \ + \ +{{ ) else "" end -}} + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/Dockerfile-windowsservercore.template b/Dockerfile-windowsservercore.template deleted file mode 100644 index 01d1a8c36..000000000 --- a/Dockerfile-windowsservercore.template +++ /dev/null @@ -1,49 +0,0 @@ -FROM microsoft/windowsservercore - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] - -ENV PYTHON_VERSION %%PLACEHOLDER%% -ENV PYTHON_RELEASE %%PLACEHOLDER%% - -# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% - -RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ - Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ - \ - Write-Host 'Installing ...'; \ -# https://docs.python.org/3.5/using/windows.html#installing-without-ui - Start-Process python.exe -Wait \ - -ArgumentList @( \ - '/quiet', \ - 'InstallAllUsers=1', \ - 'TargetDir=C:\Python', \ - 'PrependPath=1', \ - 'Shortcuts=0', \ - 'Include_doc=0', \ - 'Include_test=0' \ - ); \ - \ -# the installer updated PATH, so we should refresh our local value - $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ...'; \ - Write-Host ' python --version'; python --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item python.exe -Force; \ - \ - $pipInstall = ('pip=={0}' -f $env:PYTHON_PIP_VERSION); \ - Write-Host ('Installing {0} ...' -f $pipInstall); \ -# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python -# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") -# https://github.com/docker-library/python/pull/143#issuecomment-241032683 - pip install --no-cache-dir --upgrade --force-reinstall $pipInstall; \ - \ - Write-Host 'Verifying pip install ...'; \ - pip --version; \ - \ - Write-Host 'Complete.'; - -CMD ["python"] diff --git a/LICENSE b/LICENSE index 25714b8b4..fbab368db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2015 Docker, Inc. +Copyright (c) 2014 Docker, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index f2748854a..3d5b277d3 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ -# About this Repo +# https://github.com/docker-library/python -This is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [python](https://registry.hub.docker.com/_/python/). See [the Docker Hub page](https://registry.hub.docker.com/_/python/) for the full readme on how to use this Docker image and for information regarding contributing and issues. +## Maintained by: [the Docker Community](https://github.com/docker-library/python) -The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specifically in [docker-library/docs/python](https://github.com/docker-library/docs/tree/master/python). +This is the Git repo of the [Docker "Official Image"](https://github.com/docker-library/official-images#what-are-official-images) for [`python`](https://hub.docker.com/_/python/) (not to be confused with any official `python` image provided by `python` upstream). See [the Docker Hub page](https://hub.docker.com/_/python/) for the full readme on how to use this Docker image and for information regarding contributing and issues. -See a change merged here that doesn't show up on the Docker Hub yet? Check [the "library/python" manifest file in the docker-library/official-images repo](https://github.com/docker-library/official-images/blob/master/library/python), especially [PRs with the "library/python" label on that repo](https://github.com/docker-library/official-images/labels/library%2Fpython). For more information about the official images process, see the [docker-library/official-images readme](https://github.com/docker-library/official-images/blob/master/README.md). +The [full image description on Docker Hub](https://hub.docker.com/_/python/) is generated/maintained over in [the docker-library/docs repository](https://github.com/docker-library/docs), specifically in [the `python` directory](https://github.com/docker-library/docs/tree/master/python). ---- +## See a change merged here that doesn't show up on Docker Hub yet? -- [Travis CI: - ![build status badge](https://img.shields.io/travis/docker-library/python/master.svg)](https://travis-ci.org/docker-library/python/branches) -- [Automated `update.sh`: - ![build status badge](https://doi-janky.infosiftr.net/job/update.sh/job/python/badge/icon)](https://doi-janky.infosiftr.net/job/update.sh/job/python) +For more information about the full official images change lifecycle, see [the "An image's source changed in Git, now what?" FAQ entry](https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what). + +For outstanding `python` image PRs, check [PRs with the "library/python" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2Fpython). For the current "source of truth" for [`python`](https://hub.docker.com/_/python/), see [the `library/python` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/python). diff --git a/apply-templates.sh b/apply-templates.sh new file mode 100755 index 000000000..b4587fe5e --- /dev/null +++ b/apply-templates.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +[ -f versions.json ] # run "versions.sh" first + +jqt='.jq-template.awk' +if [ -n "${BASHBREW_SCRIPTS:-}" ]; then + jqt="$BASHBREW_SCRIPTS/jq-template.awk" +elif [ "$BASH_SOURCE" -nt "$jqt" ]; then + # https://github.com/docker-library/bashbrew/blob/master/scripts/jq-template.awk + wget -qO "$jqt" 'https://github.com/docker-library/bashbrew/raw/9f6a35772ac863a0241f147c820354e4008edf38/scripts/jq-template.awk' +fi + +if [ "$#" -eq 0 ]; then + versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)" + eval "set -- $versions" +fi + +generated_warning() { + cat <<-EOH + # + # NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" + # + # PLEASE DO NOT EDIT IT DIRECTLY. + # + + EOH +} + +for version; do + export version + + rm -rf "$version/" + + variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)" + eval "variants=( $variants )" + + for dir in "${variants[@]}"; do + variant="$(basename "$dir")" # "buster", "windowsservercore-1809", etc + export variant + + case "$dir" in + windows/*) + windowsVariant="${variant%%-*}" # "windowsservercore", "nanoserver" + windowsRelease="${variant#$windowsVariant-}" # "ltsc2022", "1809", etc + windowsVariant="${windowsVariant#windows}" # "servercore", "nanoserver" + export windowsVariant windowsRelease + template='Dockerfile-windows.template' + ;; + + *) + template='Dockerfile-linux.template' + ;; + esac + + echo "processing $version/$dir ..." + mkdir -p "$version/$dir" + + { + generated_warning + gawk -f "$jqt" "$template" + } > "$version/$dir/Dockerfile" + done +done diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 92bf0e3b9..a1ef13fe7 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -1,16 +1,20 @@ -#!/bin/bash -set -eu +#!/usr/bin/env bash +set -Eeuo pipefail declare -A aliases=( - [3.5]='3 latest' - [2.7]='2' + [3.13]='3 latest' ) self="$(basename "$BASH_SOURCE")" cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" -versions=( */ ) -versions=( "${versions[@]%/}" ) +if [ "$#" -eq 0 ]; then + versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)" + eval "set -- $versions" +fi + +# sort version numbers with highest first +IFS=$'\n'; set -- $(sort -rV <<<"$*"); unset IFS # get the most recent commit which modified any of "$@" fileCommit() { @@ -22,24 +26,47 @@ dirCommit() { local dir="$1"; shift ( cd "$dir" - fileCommit \ - Dockerfile \ - $(git show HEAD:./Dockerfile | awk ' + files="$( + git show HEAD:./Dockerfile | awk ' toupper($1) == "COPY" { for (i = 2; i < NF; i++) { + if ($i ~ /^--from=/) { + next + } print $i } } - ') + ' + )" + fileCommit Dockerfile $files ) } +getArches() { + local repo="$1"; shift + local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/" + + local parentRepoToArchesStr + parentRepoToArchesStr="$( + find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" ' + toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ { + printf "%s%s\n", officialImagesBase, $2 + } + ' '{}' + \ + | sort -u \ + | xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"' + )" + eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )" +} +getArches 'python' + cat <<-EOH # this file is generated via https://github.com/docker-library/python/blob/$(fileCommit "$self")/$self Maintainers: Tianon Gravi (@tianon), Joseph Ferguson (@yosifkit) GitRepo: https://github.com/docker-library/python.git +Builder: buildkit EOH # prints "$2$1$3$1...$N" @@ -49,10 +76,12 @@ join() { echo "${out#$sep}" } -for version in "${versions[@]}"; do - commit="$(dirCommit "$version")" +for version; do + export version + variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)" + eval "variants=( $variants )" - fullVersion="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "ENV" && $2 == "PYTHON_VERSION" { print $3; exit }')" + fullVersion="$(jq -r '.[env.version].version' versions.json)" versionAliases=( $fullVersion @@ -60,33 +89,92 @@ for version in "${versions[@]}"; do ${aliases[$version]:-} ) - echo - cat <<-EOE - Tags: $(join ', ' "${versionAliases[@]}") - GitCommit: $commit - Directory: $version - EOE - - for v in \ - slim alpine wheezy onbuild \ - windows/windowsservercore windows/nanoserver \ - ; do + defaultDebianVariant="$(jq -r ' + .[env.version].variants + | map(select( + startswith("alpine") + or startswith("slim-") + or startswith("windows/") + | not + )) + | .[0] + ' versions.json)" + defaultAlpineVariant="$(jq -r ' + .[env.version].variants + | map(select( + startswith("alpine") + )) + | .[0] + ' versions.json)" + + for v in "${variants[@]}"; do dir="$version/$v" - variant="$(basename "$v")" - [ -f "$dir/Dockerfile" ] || continue + variant="$(basename "$v")" commit="$(dirCommit "$dir")" variantAliases=( "${versionAliases[@]/%/-$variant}" ) + case "$variant" in + *-"$defaultDebianVariant") # slim-xxx -> slim + variantAliases+=( "${versionAliases[@]/%/-${variant%-$defaultDebianVariant}}" ) + ;; + "$defaultAlpineVariant") + variantAliases+=( "${versionAliases[@]/%/-alpine}" ) + ;; + esac variantAliases=( "${variantAliases[@]//latest-/}" ) + case "$v" in + windows/*) + variantArches='windows-amd64' + ;; + + *) + variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile")" + variantArches="${parentRepoToArches[$variantParent]}" + ;; + esac + + # https://github.com/python/cpython/issues/93619 (Linking error when building 3.11 beta on mips64le) + https://peps.python.org/pep-0011/ (mips is not even tier 3) + case "$version" in + 3.9) ;; + *) variantArches="$(sed <<<" $variantArches " -e 's/ mips64le / /g')" ;; + esac + + # https://github.com/docker-library/python/issues/1014 (ensurepip failing on s390x 3.14.0a6 Alpine images) + if [[ "$variant" == alpine* ]]; then + case "$version" in + 3.9 | 3.10 | 3.11 | 3.12 | 3.13) ;; + *) variantArches="$(sed <<<" $variantArches " -e 's/ s390x / /g')" ;; + esac + fi + + sharedTags=() + for windowsShared in windowsservercore nanoserver; do + if [[ "$variant" == "$windowsShared"* ]]; then + sharedTags=( "${versionAliases[@]/%/-$windowsShared}" ) + sharedTags=( "${sharedTags[@]//latest-/}" ) + break + fi + done + if [ "$variant" = "$defaultDebianVariant" ] || [[ "$variant" == 'windowsservercore'* ]]; then + sharedTags+=( "${versionAliases[@]}" ) + fi + echo + echo "Tags: $(join ', ' "${variantAliases[@]}")" + if [ "${#sharedTags[@]}" -gt 0 ]; then + echo "SharedTags: $(join ', ' "${sharedTags[@]}")" + fi cat <<-EOE - Tags: $(join ', ' "${variantAliases[@]}") + Architectures: $(join ', ' $variantArches) GitCommit: $commit Directory: $dir EOE - [ "$variant" = "$v" ] || echo "Constraints: $variant" + if [[ "$v" == windows/* ]]; then + echo "Constraints: $variant" + echo 'Builder: classic' + fi done done diff --git a/update.sh b/update.sh index fae90ae29..bac2d7581 100755 --- a/update.sh +++ b/update.sh @@ -1,105 +1,7 @@ -#!/bin/bash -set -e -shopt -s nullglob - -declare -A gpgKeys=( - # gpg: key 18ADD4FF: public key "Benjamin Peterson " imported - [2.7]='C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF' - # https://www.python.org/dev/peps/pep-0373/#release-manager-and-crew - - # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported - [3.3]='26DEA9D4613391EF3E25C9FF0A5B101836580288' - # https://www.python.org/dev/peps/pep-0398/#release-manager-and-crew - - # gpg: key F73C700D: public key "Larry Hastings " imported - [3.4]='97FC712E4C024BBEA48A61ED3A5CA953F73C700D' - # https://www.python.org/dev/peps/pep-0429/#release-manager-and-crew - - # gpg: key F73C700D: public key "Larry Hastings " imported - [3.5]='97FC712E4C024BBEA48A61ED3A5CA953F73C700D' - # https://www.python.org/dev/peps/pep-0478/#release-manager-and-crew - - # gpg: key AA65421D: public key "Ned Deily (Python release signing key) " imported - [3.6]='0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' - # https://www.python.org/dev/peps/pep-0494/#release-manager-and-crew -) +#!/usr/bin/env bash +set -Eeuo pipefail cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" -versions=( "$@" ) -if [ ${#versions[@]} -eq 0 ]; then - versions=( */ ) -fi -versions=( "${versions[@]%/}" ) - -pipVersion="$(curl -fsSL 'https://pypi.python.org/pypi/pip/json' | awk -F '"' '$2 == "version" { print $4 }')" - -generated_warning() { - cat <<-EOH - # - # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" - # - # PLEASE DO NOT EDIT IT DIRECTLY. - # - - EOH -} - -travisEnv= -for version in "${versions[@]}"; do - # Python 2.7.8 - # Python 3.4.1 - fullVersion="$(curl -fsSL 'https://www.python.org/downloads/' | awk -F 'Python |' '/]+>Python '"$version"'./ { print $2 }' | grep -v 'rc' | sort -V | tail -1)" - # TODO figure out a better way to handle RCs than just filtering them out - if [ -z "$fullVersion" ]; then - { - echo - echo - echo " warning: cannot find $version (alpha/beta/rc?)" - echo - echo - } >&2 - else - if [[ "$version" != 2.* ]]; then - for variant in \ - debian \ - alpine \ - slim \ - onbuild \ - windows/windowsservercore \ - ; do - if [ "$variant" = 'debian' ]; then - dir="$version" - else - dir="$version/$variant" - variant="$(basename "$variant")" - fi - [ -d "$dir" ] || continue - template="Dockerfile-$variant.template" - { generated_warning; cat "$template"; } > "$dir/Dockerfile" - done - if [ -d "$version/wheezy" ]; then - cp "$version/Dockerfile" "$version/wheezy/Dockerfile" - sed -ri 's/:jessie/:wheezy/g' "$version/wheezy/Dockerfile" - fi - fi - ( - set -x - sed -ri \ - -e 's/^(ENV GPG_KEY) .*/\1 '"${gpgKeys[$version]}"'/' \ - -e 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' \ - -e 's/^(ENV PYTHON_RELEASE) .*/\1 '"${fullVersion%%[a-z]*}"'/' \ - -e 's/^(ENV PYTHON_PIP_VERSION) .*/\1 '"$pipVersion"'/' \ - -e 's/^(FROM python):.*/\1:'"$version"'/' \ - "$version"/{,*/,*/*/}Dockerfile - ) - fi - for variant in wheezy alpine slim; do - [ -d "$version/$variant" ] || continue - travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv" - done - travisEnv='\n - VERSION='"$version VARIANT=$travisEnv" -done - -travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" -echo "$travis" > .travis.yml +./versions.sh "$@" +./apply-templates.sh "$@" diff --git a/versions.json b/versions.json new file mode 100644 index 000000000..a6141223d --- /dev/null +++ b/versions.json @@ -0,0 +1,125 @@ +{ + "3.10": { + "checksums": { + "source": { + "sha256": "4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0" + } + }, + "setuptools": { + "version": "65.5.1" + }, + "variants": [ + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "alpine3.21", + "alpine3.20" + ], + "version": "3.10.17" + }, + "3.11": { + "checksums": { + "source": { + "sha256": "849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09" + } + }, + "setuptools": { + "version": "65.5.1" + }, + "variants": [ + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "alpine3.21", + "alpine3.20" + ], + "version": "3.11.12" + }, + "3.12": { + "checksums": { + "source": { + "sha256": "07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea" + }, + "windows": { + "sha256": "67b5635e80ea51072b87941312d00ec8927c4db9ba18938f7ad2d27b328b95fb" + } + }, + "variants": [ + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "alpine3.21", + "alpine3.20", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022", + "windows/windowsservercore-1809" + ], + "version": "3.12.10" + }, + "3.13": { + "checksums": { + "source": { + "sha256": "40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041" + }, + "windows": { + "sha256": "698f2df46e1a3dd92f393458eea77bd94ef5ff21f0d5bf5cf676f3d28a9b4b6c" + } + }, + "variants": [ + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "alpine3.21", + "alpine3.20", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022", + "windows/windowsservercore-1809" + ], + "version": "3.13.3" + }, + "3.14-rc": { + "checksums": { + "source": { + "sha256": "2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39" + }, + "windows": { + "sha256": "a878026c12b1a606d02f5bbf3ed65aa780ee8272964b8f95d8348ffa2d6ca096" + } + }, + "variants": [ + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "alpine3.21", + "alpine3.20", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022", + "windows/windowsservercore-1809" + ], + "version": "3.14.0b1" + }, + "3.9": { + "checksums": { + "source": { + "sha256": "8c136d199d3637a1fce98a16adc809c1d83c922d02d41f3614b34f8b6e7d38ec" + } + }, + "setuptools": { + "version": "58.1.0" + }, + "variants": [ + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "alpine3.21", + "alpine3.20" + ], + "version": "3.9.22" + } +} diff --git a/versions.sh b/versions.sh new file mode 100755 index 000000000..f574d65d2 --- /dev/null +++ b/versions.sh @@ -0,0 +1,230 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +shopt -s nullglob + +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" + +versions=( "$@" ) +if [ ${#versions[@]} -eq 0 ]; then + versions=( */ ) + json='{}' +else + json="$(< versions.json)" +fi +versions=( "${versions[@]%/}" ) + +declare -A checksums=() +check_file() { + local dirVersion="$1"; shift + local fullVersion="$1"; shift + local type="${1:-source}" # "source" or "windows" + + local filename="Python-$fullVersion.tar.xz" + if [ "$type" = 'windows' ]; then + filename="python-$fullVersion-amd64.exe" + fi + local url="https://www.python.org/ftp/python/$dirVersion/$filename" + + local sigstore + if sigstore="$( + wget -qO- -o/dev/null "$url.sigstore" \ + | jq -r ' + .messageSignature.messageDigest + | if .algorithm != "SHA2_256" then + error("sigstore bundle not using SHA2_256") + else .digest end + ' + )" && [ -n "$sigstore" ]; then + sigstore="$(base64 -d <<<"$sigstore" | hexdump -ve '/1 "%02x"')" + checksums["$fullVersion"]="$(jq <<<"${checksums["$fullVersion"]:-null}" --arg type "$type" --arg sha256 "$sigstore" '.[$type].sha256 = $sha256')" + return 0 + fi + + # TODO is this even necessary/useful? the sigstore-based version above is *much* faster, supports all current versions (not just 3.12+ like this), *and* should be more reliable 🤔 + local sbom + if sbom="$( + wget -qO- -o/dev/null "$url.spdx.json" \ + | jq --arg filename "$filename" ' + first( + .packages[] + | select( + .name == "CPython" + and .packageFileName == $filename + ) + ) + | .checksums + | map({ + key: (.algorithm // empty | ascii_downcase), + value: (.checksumValue // empty), + }) + | if length < 1 then + error("no checksums found for \($filename)") + else . end + | from_entries + | if has("sha256") then . else + error("missing sha256 for \($filename); have \(.)") + end + ' + )" && [ -n "sbom" ]; then + checksums["$fullVersion"]="$(jq <<<"${checksums["$fullVersion"]:-null}" --arg type "$type" --argjson sums "$sbom" '.[$type] += $sums')" + return 0 + fi + + if ! wget -q -O /dev/null -o /dev/null --spider "$url"; then + return 1 + fi + + return 0 +} + +for version in "${versions[@]}"; do + rcVersion="${version%-rc}" + export version rcVersion + + rcGrepV='-v' + if [ "$rcVersion" != "$version" ]; then + rcGrepV= + fi + + possibles=( $( + { + git ls-remote --tags https://github.com/python/cpython.git "refs/tags/v${rcVersion}.*" \ + | sed -r 's!^.*refs/tags/v([0-9a-z.]+).*$!\1!' \ + | grep $rcGrepV -E -- '[a-zA-Z]+' \ + || : + + # this page has a very aggressive varnish cache in front of it, which is why we also scrape tags from GitHub + wget -qO- 'https://www.python.org/ftp/python/' \ + | grep '&2 + exit 1 + fi + + ensurepipVersions="$( + wget -qO- "https://github.com/python/cpython/raw/v$fullVersion/Lib/ensurepip/__init__.py" \ + | grep -E '^[^[:space:]]+_VERSION[[:space:]]*=' + )" + + # Note: We don't extract the pip version here, since our policy is now to use the pip version + # that is installed during the Python build (which is the version bundled in ensurepip), and + # to not support overriding it. + + # TODO remove setuptools version handling entirely once Python 3.11 is EOL + setuptoolsVersion="$(sed -nre 's/^_SETUPTOOLS_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")" + case "$rcVersion" in + 3.9 | 3.10 | 3.11) + if [ -z "$setuptoolsVersion" ]; then + echo >&2 "error: $version: missing setuptools version" + exit 1 + fi + if ! wget -q -O /dev/null -o /dev/null --spider "https://pypi.org/pypi/setuptools/$setuptoolsVersion/json"; then + echo >&2 "error: $version: setuptools version ($setuptoolsVersion) seems to be invalid?" + exit 1 + fi + + # https://github.com/docker-library/python/issues/781 (TODO remove this if 3.10 and 3.11 embed a newer setuptools and this section no longer applies) + if [ "$setuptoolsVersion" = '65.5.0' ]; then + setuptoolsVersion='65.5.1' + fi + ;; + + *) + # https://github.com/python/cpython/issues/95299 -> https://github.com/python/cpython/commit/ece20dba120a1a4745721c49f8d7389d4b1ee2a7 + if [ -n "$setuptoolsVersion" ]; then + echo >&2 "error: $version: unexpected setuptools: $setuptoolsVersion" + exit 1 + fi + ;; + esac + + echo "$version: $fullVersion" + + export fullVersion pipVersion setuptoolsVersion hasWindows + doc="$(jq -nc ' + { + version: env.fullVersion, + variants: [ + ( + "bookworm", + "bullseye", + empty + | ., "slim-" + .), # https://github.com/docker-library/ruby/pull/142#issuecomment-320012893 + ( + "3.21", + "3.20", + empty + | "alpine" + .), + if env.hasWindows != "" then + ( + "ltsc2025", + "ltsc2022", + "1809", + empty + | "windows/windowsservercore-" + .) + else empty end + ], + } + if env.setuptoolsVersion != "" then { + setuptools: { + version: env.setuptoolsVersion, + }, + } else {} end + ')" + + if [ -n "${checksums["$fullVersion"]:-}" ]; then + doc="$(jq <<<"$doc" -c --argjson checksums "${checksums["$fullVersion"]}" '.checksums = $checksums')" + fi + + json="$(jq <<<"$json" -c --argjson doc "$doc" '.[env.version] = $doc')" +done + +jq <<<"$json" -S . > versions.json