FROM ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive \ UV_LINK_MODE=copy \ UV_CACHE_DIR=/opt/uv-cache \ UV_PYTHON_INSTALL_DIR=/usr/local/share/uv/python \ UV_PYTHON_BIN_DIR=/usr/local/bin \ RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ COREPACK_HOME=/opt/corepack \ PATH=/usr/local/go/bin:/usr/local/cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin RUN apt-get update && apt-get install -y --no-install-recommends \ bash build-essential ca-certificates curl git jq passwd pkg-config procps unzip xz-utils \ && rm -rf /var/lib/apt/lists/* ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright RUN mkdir -p "$PLAYWRIGHT_BROWSERS_PATH" && chmod 755 "$PLAYWRIGHT_BROWSERS_PATH" \ && arch="$(dpkg --print-architecture)" && case "$arch" in arm64) node_arch=arm64 ;; amd64) node_arch=x64 ;; *) exit 1 ;; esac \ && curl -fsSL "https://nodejs.org/dist/v22.14.0/node-v22.14.0-linux-${node_arch}.tar.xz" | tar -C /usr/local --strip-components=1 -xJ \ && mkdir -p /opt/corepack && chmod 755 /opt/corepack \ && corepack enable COPY repo.tar.gz /tmp/repo.tar.gz RUN mkdir -p /app && tar -xzf /tmp/repo.tar.gz -C /app && rm /tmp/repo.tar.gz \ && git -C /app init -q \ && git -C /app config user.email selfbench@local \ && git -C /app config user.name selfbench \ && git -C /app add -A \ && git -C /app commit -qm base RUN mkdir -p /opt/uv-cache && chmod 777 /opt/uv-cache \ && cd '/app/.' \ && bash -lc 'corepack enable && pnpm install --frozen-lockfile && pnpm build' \ && chmod -R a+rwX /opt/uv-cache RUN useradd --create-home --shell /bin/bash verifier \ && chown -R verifier:verifier /app /opt/uv-cache \ && mkdir -p /opt/selfbench \ && chmod 700 /opt/selfbench \ && mkdir -p /home/verifier/.cache/uv \ && chown -R verifier:verifier /home/verifier/.cache ENV UV_CACHE_DIR=/home/verifier/.cache/uv \ UV_NO_BUILD_ISOLATION=1 COPY test.patch test.sh /tests/ RUN chmod 700 /tests && chmod 600 /tests/test.patch && chmod +x /tests/test.sh WORKDIR /app