FROM debian:trixie-slim AS builder ARG TARGETARCH ARG TARGETVARIANT ENV DEBIAN_FRONTEND=noninteractive WORKDIR /app RUN --mount=type=cache,target=/var/cache/apt,id=apt-cahce-1-$TARGETARCH$TARGETVARIANT-builder,sharing=locked \ --mount=type=cache,target=/var/lib/apt,id=apt-cahce-2-$TARGETARCH$TARGETVARIANT-builder,sharing=locked \ < /etc/apt/apt.conf.d/keep-cache echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/no-recommends echo 'APT::AutoRemove::RecommendsImportant "0";' >> /etc/apt/apt.conf.d/no-recommends apt-get update apt-get install -y libtool make cmake libseccomp-dev gcc python3 python3-venv EOS COPY Judger/ /app/ RUN < /etc/apt/apt.conf.d/keep-cache echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/no-recommends echo 'APT::AutoRemove::RecommendsImportant "0";' >> /etc/apt/apt.conf.d/no-recommends needed="python3.12-minimal \ python3.12-venv \ libpython3.12-stdlib \ libpython3.12-dev \ golang-1.22-go \ temurin-21-jdk \ gcc-13 \ g++-13 \ nodejs \ strace" savedAptMark="$(apt-mark showmanual) $needed" apt-get update apt-get install -y ca-certificates curl gnupg curl -fsSL https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor -o /etc/apt/keyrings/adoptium.gpg cat > /etc/apt/sources.list.d/adoptium.sources < /etc/apt/sources.list.d/nodesource.sources < /dev/null apt-mark manual $savedAptMark apt-get purge -y --auto-remove EOS COPY --from=builder --chmod=755 --link /app/output/libjudger.so /usr/lib/judger/libjudger.so COPY --from=builder /app/bindings/Python/dist/ /app/ RUN --mount=type=cache,target=/root/.cache/pip,id=pip-cahce-$TARGETARCH$TARGETVARIANT-final \ <