# WyOJ judger image. # # Build context is this directory: # docker build -t wyoj-judger ./judger # # The base image MUST stay ubuntu:18.04. uoj_judger/include/uoj_work_path.h # selects the sandbox's syscall/readable-file whitelist with # UOJ_JUDGER_BASESYSTEM_UBUNTU1804 and UOJ_JUDGER_PYTHON3_VERSION "3.6", and # bionic is the release that actually ships python3.6 (see # uoj_judger/run/run_program_conf.h around line 362-410). A 20.04 base would # silently break Python submissions. # # This runs with judge_client's default (foreground) mode, so the container # logs go to `docker logs`; the `start` mode of judge_client daemonises into # log/judge.log and is not used here. FROM ubuntu:18.04 LABEL org.opencontainers.image.source=https://git.ryp.org.cn/wyoj/wyoj-raw LABEL org.opencontainers.image.description="WyOJ Judger" LABEL org.opencontainers.image.licenses=MIT ENV DEBIAN_FRONTEND=noninteractive # python3-requests is used by judge_client; g++/make are needed both to compile # submissions and to rebuild uoj_judger during self-update (socket cmd=update). RUN apt-get update && apt-get install -y \ python3 python3-requests \ make g++ binutils \ unzip zip \ ca-certificates procps \ && rm -rf /var/lib/apt/lists/* # /opt/uoj/judger must match UOJ_WORK_PATH in include/uoj_work_path.h -- the # compiled main_judger uses that absolute path at runtime. COPY . /opt/uoj/judger WORKDIR /opt/uoj/judger RUN set -eux; \ chmod +x judge_client docker-entrypoint.sh register-judger.sh; \ make -C uoj_judger all -j"$(nproc)"; \ mkdir -p uoj_judger/work uoj_judger/result uoj_judger/data log /var/uoj_data_copy; \ chmod -R 777 uoj_judger/work uoj_judger/result log ENV LANG=C.UTF-8 TZ=Asia/Shanghai # judge_client listens here for {password, cmd} tasks from # /judge/sync-judge-client (the port comes from the web's judger.socket.port). EXPOSE 2333 CMD ["/opt/uoj/judger/docker-entrypoint.sh"]