FROM archlinux:base-devel

# Install dependencies
RUN pacman -Syu --noconfirm && \
    pacman -S --noconfirm \
    git \
    openssh \
    gnupg \
    python \
    python-pip \
    python-requests \
    python-yaml \
    python-gitpython \
    python-pytest \
    python-pytest-cov && \
    # Clean up
    pacman -Scc --noconfirm && \
    rm -rf /var/cache/pacman/pkg/* && \
    rm -rf /var/lib/pacman/sync/*

# Create non-root user with specific UID/GID to match GitHub Actions
RUN useradd -u 1001 -m -s /bin/bash runner && \
    echo "runner ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
    mkdir -p /github/workspace && \
    chown -R runner:runner /github/workspace

USER runner
WORKDIR /github/workspace

# Pre-configure git for container reuse
RUN git config --global --add safe.directory '*' 