|
1 |
| -FROM ubuntu:jammy |
| 1 | +FROM ubuntu:jammy AS base |
2 | 2 |
|
3 | 3 | RUN apt-get update && \
|
4 | 4 | apt-get install -y --no-install-recommends \
|
@@ -26,17 +26,34 @@ RUN if [ "$(arch)" = x86_64 ]; then DEB_ARCH=amd64; else DEB_ARCH=arm64; fi && \
|
26 | 26 | curl -L -O $GCC_FILES_URL/libtsan0_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
|
27 | 27 | dpkg -i *.deb && rm *.deb
|
28 | 28 |
|
29 |
| -RUN if [ "$(arch)" = x86_64 ]; then PYPY_ARCH=linux64; else PYPY_ARCH="$(arch)"; fi && \ |
30 |
| - mkdir /opt/pypy3 && curl -L "https://downloads.python.org/pypy/pypy3.9-v7.3.10-$PYPY_ARCH.tar.bz2" | \ |
31 |
| - tar xj -C /opt/pypy3 --strip-components=1 && /opt/pypy3/bin/pypy -mcompileall && \ |
32 |
| - rm -f /opt/pypy3/bin/python* |
33 |
| - |
34 | 29 | RUN curl -L -okotlin.zip https://github.com/JetBrains/kotlin/releases/download/v1.7.21/kotlin-compiler-1.7.21.zip && \
|
35 | 30 | unzip kotlin.zip && mv kotlinc /opt/kotlin && rm kotlin.zip
|
36 | 31 |
|
37 | 32 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
38 | 33 | useradd -m judge
|
39 | 34 |
|
40 |
| -ENV PATH="/opt/kotlin/bin:/opt/pypy3/bin:${PATH}" |
| 35 | +FROM base AS build |
| 36 | + |
| 37 | +RUN apt-get update && apt-get install -y dpkg-dev devscripts equivs |
| 38 | + |
| 39 | +RUN mkdir /build-pypy3 && \ |
| 40 | + cd /build-pypy3 && \ |
| 41 | + curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg-1.dsc && \ |
| 42 | + curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg.orig-cpython27.tar.xz && \ |
| 43 | + curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg.orig.tar.xz && \ |
| 44 | + curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg-1.debian.tar.xz && \ |
| 45 | + dpkg-source -x pypy3_7.3.10+dfsg-1.dsc && \ |
| 46 | + cd pypy3-7.3.10+dfsg && \ |
| 47 | + mk-build-deps && apt-get install -y ./pypy3-build-deps_7.3.10+dfsg-1_all.deb && \ |
| 48 | + dpkg-buildpackage -us -uc -b |
| 49 | + |
| 50 | +FROM base AS main |
| 51 | + |
| 52 | +COPY --from=build /build-pypy3/pypy3-lib_7.3.10+dfsg-1_amd64.deb pypy3-lib_7.3.10+dfsg-1_amd64.deb |
| 53 | +COPY --from=build /build-pypy3/pypy3_7.3.10+dfsg-1_amd64.deb pypy3_7.3.10+dfsg-1_amd64.deb |
| 54 | + |
| 55 | +RUN dpkg -i pypy3-lib_7.3.10+dfsg-1_amd64.deb && dpkg -i pypy3_7.3.10+dfsg-1_amd64.deb && rm -rf *.deb |
| 56 | + |
| 57 | +ENV PATH="/opt/kotlin/bin:${PATH}" |
41 | 58 |
|
42 | 59 | ENTRYPOINT ["/usr/bin/tini", "/code/run"]
|
0 commit comments