|
| 1 | +FROM ubuntu:jammy AS base |
| 2 | + |
| 3 | +RUN apt-get update && \ |
| 4 | + apt-get install -y --no-install-recommends \ |
| 5 | + curl file gcc g++ python3-full python3-pip python3-dev python3-setuptools python3-wheel cython3 libseccomp-dev bzip2 unzip \ |
| 6 | + fp-compiler tini ca-certificates-java \ |
| 7 | + $([ "$(arch)" = aarch64 ] && echo binutils-arm-linux-gnueabihf) |
| 8 | + |
| 9 | +RUN if [ "$(arch)" = x86_64 ]; then DEB_ARCH=amd64; else DEB_ARCH=arm64; fi && \ |
| 10 | + if [ "$(arch)" = x86_64 ]; then OPENJDK_BUILD=24567508; else OPENJDK_BUILD=24567509; fi && \ |
| 11 | + OPENJDK_FILES_URL="https://launchpad.net/~openjdk-security/+archive/ubuntu/ppa/+build/$OPENJDK_BUILD/+files" && \ |
| 12 | + curl -L -O $OPENJDK_FILES_URL/openjdk-17-jdk-headless_17.0.5+8-2ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 13 | + curl -L -O $OPENJDK_FILES_URL/openjdk-17-jre-headless_17.0.5+8-2ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 14 | + dpkg -i *.deb && rm *.deb |
| 15 | + |
| 16 | +RUN if [ "$(arch)" = x86_64 ]; then DEB_ARCH=amd64; else DEB_ARCH=arm64; fi && \ |
| 17 | + if [ "$(arch)" = x86_64 ]; then GCC_BUILD=23596444; else GCC_BUILD=23596445; fi && \ |
| 18 | + GCC_FILES_URL="https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa/+build/$GCC_BUILD/+files" && \ |
| 19 | + curl -L -O $GCC_FILES_URL/cpp-11_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 20 | + curl -L -O $GCC_FILES_URL/g++-11_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 21 | + curl -L -O $GCC_FILES_URL/gcc-11_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 22 | + curl -L -O $GCC_FILES_URL/gcc-11-base_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 23 | + curl -L -O $GCC_FILES_URL/libasan6_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 24 | + curl -L -O $GCC_FILES_URL/libgcc-11-dev_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 25 | + curl -L -O $GCC_FILES_URL/libstdc++-11-dev_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 26 | + curl -L -O $GCC_FILES_URL/libtsan0_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \ |
| 27 | + dpkg -i *.deb && rm *.deb |
| 28 | + |
| 29 | +RUN curl -L -okotlin.zip https://github.com/JetBrains/kotlin/releases/download/v1.7.21/kotlin-compiler-1.7.21.zip && \ |
| 30 | + unzip kotlin.zip && mv kotlinc /opt/kotlin && rm kotlin.zip |
| 31 | + |
| 32 | +RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \ |
| 33 | + useradd -m judge |
| 34 | + |
| 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}" |
| 58 | + |
| 59 | +ENTRYPOINT ["/usr/bin/tini", "/code/run"] |
0 commit comments