FROM ubuntu:24.04

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        binutils \
        build-essential \
        ca-certificates \
        clang \
        file \
        gdb \
        git \
        jq \
        less \
        ltrace \
        python3 \
        python3-capstone \
        python3-pyelftools \
        ripgrep \
        strace \
        vim-tiny \
        xxd \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY challenge/ /app/challenge/
COPY include/ /app/include/
COPY templates/ /app/templates/
COPY samples.json /app/samples.json
COPY collect_task_output.py /opt/twilightbench/collect_task_output.py

RUN chmod 0555 /app/challenge/twilight_vm \
    && chmod 0444 /app/include/twilight_transform.h /app/samples.json \
    && find /app/templates -type f -exec chmod 0444 {} \;
