File size: 2,347 Bytes
4514571
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | env RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo sh -s -- -y --no-modify-path --profile minimal --default-toolchain 1.90.0
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 && corepack prepare pnpm@10.33.0 --activate && pnpm install --frozen-lockfile && pnpm swc-build-native && 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