Spaces:
Running
Running
File size: 2,471 Bytes
dc71cad | 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:22.04
# ββ System dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
wget \
build-essential \
libssl-dev \
libffi-dev \
python3.11 \
python3.11-dev \
python3.11-venv \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# ββ Make python3 point to python3.11 βββββββββββββββββββββββββββββββββββββββββ
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
# ββ Create non-root user (uid=1000) ββββββββββββββββββββββββββββββββββββββββββ
RUN groupadd -g 1000 agent && useradd -u 1000 -g agent -m -s /bin/bash agent
# ββ Upgrade pip and install test runner ββββββββββββββββββββββββββββββββββββββ
RUN python -m pip install --upgrade pip setuptools wheel && \
pip install pytest pytest-xdist pytest-timeout
# ββ Workspace setup βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
RUN mkdir -p /workspace && chown agent:agent /workspace
# ββ Git configuration (needed for git apply) ββββββββββββββββββββββββββββββββββ
RUN git config --global user.email "agent@code-agent" && \
git config --global user.name "Code Agent" && \
git config --global safe.directory '/workspace'
# ββ Switch to non-root user βββββββββββββββββββββββββββββββββββββββββββββββββββ
USER agent
WORKDIR /workspace
# ββ Default command βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Actual command is injected by SandboxExecutor at runtime
CMD ["python", "-m", "pytest", "--help"]
|