# CrossHair sandbox image for SymbolicVerifier (#431).
#
# CrossHair imports the code it analyses, which executes that code, so
# SymbolicVerifier only runs it in this image through
# SecureCodeExecutor.run_isolated(): no network, read-only root, no host
# mounts, no capabilities, no privilege escalation, user 65534, a private
# tmpfs scratch directory and memory/CPU/PID limits.
#
# Build (the tag must match DEFAULT_CROSSHAIR_IMAGE, or set QWED_CROSSHAIR_IMAGE):
#   docker build -t qwed-crosshair-sandbox:0.0.114 docker/crosshair-sandbox
#
# crosshair-tool publishes Linux wheels for x86-64 only and this image has no
# compiler, so on an ARM64 host add --platform linux/amd64 (Docker must
# emulate x86-64).
#
# The image is never pulled at runtime; if it is missing, symbolic
# verification returns BLOCKED (symbolic_verifier.runtime_unavailable).

# Same pinned base as the main QWED image.
FROM python:3.15-slim-bookworm@sha256:498829c717b1e59fc42f0e7865eafe4e04ca0f70a3769d4ae70ba218df54507c

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1

RUN pip install --no-cache-dir "crosshair-tool==0.0.114"

WORKDIR /workspace
USER 65534:65534

# Each container runs one short analysis and exits; there is no long-running
# service to probe, so health checks are disabled explicitly.
HEALTHCHECK NONE
