Files
roboco/docker/agent-base.Dockerfile
T

62 lines
2.1 KiB
Docker
Raw Normal View History

2025-12-24 22:19:43 +01:00
# =============================================================================
# Agent Base Image
2025-12-24 22:19:43 +01:00
# =============================================================================
# Python 3.13 with dev tools for Claude Code agent containers
2025-12-24 22:19:43 +01:00
# =============================================================================
2025-12-14 22:05:34 +01:00
FROM python:3.13-bookworm
2025-12-24 22:19:43 +01:00
2026-01-06 00:59:09 +01:00
# Install Node.js 22 (required for Claude Code CLI) and jq (for hooks)
2025-12-14 22:05:34 +01:00
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
git \
2025-12-24 22:19:43 +01:00
gnupg \
2026-01-06 00:59:09 +01:00
jq \
2025-12-24 22:19:43 +01:00
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
2025-12-14 22:05:34 +01:00
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Install Claude Code CLI
RUN npm install -g @anthropic-ai/claude-code
# Install uv for Python package management
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Create agent user BEFORE copying files
RUN useradd -m -s /bin/bash agent
# Create app directory and set ownership
WORKDIR /app
RUN chown agent:agent /app
# Copy MCP server code (needed for agent tools) AS agent
COPY --chown=agent:agent roboco /app/roboco
COPY --chown=agent:agent pyproject.toml uv.lock README.md /app/
# Switch to agent user for installing dependencies
USER agent
# Install Python dependencies for MCP servers (as agent)
ENV UV_HTTP_TIMEOUT=300
ENV UV_CONCURRENT_DOWNLOADS=4
2025-12-14 22:05:34 +01:00
RUN uv python install 3.13 && uv sync --frozen --python 3.13
# Claude Code will use mounted ~/.claude for auth
# System prompt mounted at /app/system-prompt.md (composed at spawn time from layers)
2025-12-14 22:05:34 +01:00
# MCP config generated at runtime
2026-01-06 00:59:09 +01:00
# Copy SDK server scripts and hooks (need to be root for COPY, then fix permissions)
USER root
COPY --chown=agent:agent docker/scripts/sdk-startup-hook.sh /app/scripts/sdk-startup-hook.sh
COPY --chown=agent:agent docker/scripts/a2a-check-hook.sh /app/scripts/a2a-check-hook.sh
2026-01-11 21:32:26 +01:00
COPY --chown=agent:agent docker/scripts/traceability-hook.sh /app/scripts/traceability-hook.sh
2026-01-06 00:59:09 +01:00
RUN chmod +x /app/scripts/*.sh
USER agent
# Expose SDK server port
EXPOSE 9000
# Claude runs directly - SDK server started via SessionStart hook
2025-12-14 22:05:34 +01:00
ENTRYPOINT ["claude"]