From 5355676130164a9a947096ac84a24db581b5ee60 Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Sat, 30 Mar 2024 10:53:02 +0800 Subject: [PATCH] build: install pypy3.10 --- Dockerfile | 11 +++++++++-- docker/install-pypy.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 docker/install-pypy.sh diff --git a/Dockerfile b/Dockerfile index 16f5362..cf01b10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,11 @@ RUN for PYTHON_VERSION in 3.6 3.11; do \ && /opt/python/${PYTHON_VERSION}/bin/python -m pip install --upgrade pip \ ; done +COPY docker/install-pypy.sh install-pypy.sh +RUN bash install-pypy.sh \ + && rm -rf /opt/conda \ + && ls -l /opt + # --------------------------------------------- FROM basic @@ -49,10 +54,12 @@ COPY docker/checkers/ /checkers/ COPY --from=sduoj/docker-compose-wait:latest /wait /wait # install Python(s) -COPY --from=py-builder /opt/python/ /opt/python/ +COPY --from=py-builder /opt/ /opt/ RUN ln -s /opt/python/3.11/bin/python /usr/bin/python3 \ && ln -s /opt/python/3.11/bin/python /usr/bin/python3.11 \ - && ln -s /opt/python/3.6/bin/python /usr/bin/python3.6 + && ln -s /opt/python/3.6/bin/python /usr/bin/python3.6 \ + && ln -s /opt/pypy/3.10/bin/pypy /usr/bin/pypy3 \ + && ln -s /opt/pypy/3.10/bin/pypy /usr/bin/pypy3.10 # install JDK(s) ENV JAVA_HOME=/opt/java/openjdk diff --git a/docker/install-pypy.sh b/docker/install-pypy.sh new file mode 100644 index 0000000..e971245 --- /dev/null +++ b/docker/install-pypy.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -eux + +dpkgArch="$(dpkg --print-architecture)" + +# install pypy3.10-v7.3.15 +case "${dpkgArch##*-}" in + 'amd64') + url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-linux64.tar.bz2' + sha256='33c584e9a70a71afd0cb7dd8ba9996720b911b3b8ed0156aea298d4487ad22c3' + ;; + 'arm64') + url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-aarch64.tar.bz2' + sha256='52146fccaf64e87e71d178dda8de63c01577ec3923073dc69e1519622bcacb74' + ;; + 'i386') + url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-linux32.tar.bz2' + sha256='75dd58c9abd8b9d78220373148355bc3119febcf27a2c781d64ad85e7232c4aa' + ;; + 's390x') + url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-s390x.tar.bz2' + sha256='209e57596381e13c9914d1332f359dc4b78de06576739747eb797bdbf85062b8' + ;; + *) + echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release" + exit 1 + ;; +esac +wget -O pypy.tar.bz2 "$url" --progress=dot:giga +echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict - +mkdir -p /opt/pypy/3.10 +tar -xjC /opt/pypy/3.10 --strip-components=1 -f pypy.tar.bz2