FROM python:3.12-slim # 1. Install System Tools # Added pkg-config and libssl-dev (Essential for Rust compilation) RUN apt-get update && apt-get install -y \ git curl build-essential unzip sudo \ ffmpeg jq zsh pkg-config libssl-dev \ default-jdk-headless \ && rm -rf /var/lib/apt/lists/* # 2. Install Starship & Aliases RUN curl -sS https://starship.rs/install.sh | sh -s -- -y RUN echo 'eval "$(starship init zsh)"' >> /root/.zshrc RUN echo 'alias ll="ls -al"' >> /root/.zshrc # Shortcuts for new tools RUN echo 'alias c="cargo"' >> /root/.zshrc RUN echo 'alias g="go"' >> /root/.zshrc # 3. Install 'uv' (Python) COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv # 4. Install Bun (JS/TS) ENV BUN_INSTALL="/root/.bun" ENV PATH="$BUN_INSTALL/bin:$PATH" RUN curl -fsSL https://bun.sh/install | bash # --- NEW SECTION: RUST SETUP --- # 5. Install Rust (Official Script) # Installs Cargo, Rustc, Rustfmt, etc. ENV RUSTUP_HOME=/root/.rustup ENV CARGO_HOME=/root/.cargo ENV PATH="$CARGO_HOME/bin:$PATH" RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile default # --- NEW SECTION: GO SETUP --- # 6. Install Go (Latest Stable) # We target 'linux-arm64' because you are on Apple Silicon (M3). ARG GO_VER=1.23.4 RUN curl -OL https://golang.org/dl/go${GO_VER}.linux-arm64.tar.gz && \ tar -C /usr/local -xzf go${GO_VER}.linux-arm64.tar.gz && \ rm go${GO_VER}.linux-arm64.tar.gz ENV PATH="/usr/local/go/bin:$PATH" # 6a basex https://files.basex.org/releases/12.2/BaseX122.zip ARG BASEX_VER=12.2/BaseX122.zip RUN curl -fsSL https://files.basex.org/releases/${BASEX_VER} -o temp.zip || { echo "Download failed"; exit 1; } && \ unzip temp.zip -d /usr/local || { echo "Extraction failed"; rm temp.zip; exit 1; } && \ rm temp.zip ENV PATH="/usr/local/basex/bin:$PATH" # 7. Install OpenCode CLI RUN curl -fsSL https://opencode.ai/install | bash ENV PATH="/root/.opencode/bin:$PATH" # 8. Install Oh-My-OpenCode RUN bunx oh-my-opencode@latest install --no-tui \ --claude=no --gemini=no --copilot=no # 9. CONFIG PART 1: Hardware/Providers (opencode.json) # Maps your local ports to providers. RUN mkdir -p /root/.config/opencode && \ cat < /root/.config/opencode/opencode.json { "plugin": ["oh-my-opencode"], "theme": "oh-my-opencode", "model": "local/glm47", "small_model": "local/gemma" "default_agent": "Sisyphus", "provider": { "local": { "npm": "@ai-sdk/openai-compatible", "name": "local models", "options": { "baseURL": "http://host.docker.internal:11434/v1" }, "models": { "glm47": { "name": "hf.co/unsloth/GLM-4.7-Flash-GGUF:Q6_K" }, "lfm2": { "name": "hf.co/LiquidAI/LFM2-24B-A2B-GGUF:Q8_0" }, "qwen3": { "name": "qwen3-coder-next:latest" }, "gemma3": {"name": "gemma3:4b"} } } } } EOF # 10. CONFIG PART 2: Agent Brains (oh-my-opencode.json) # Maps Agent Roles to Providers. RUN cat < /root/.config/opencode/oh-my-opencode.json { "agents": { "sisyphus": { "model": "local/glm47" }, "oracle": { "model": "local/lfm2" }, "librarian": { "model": "local/glm47" }, "build": { "model": "local/qwen3" } }, "disabled_agents": ["multimodal-looker"], "confirm_dangerous_actions": false } EOF WORKDIR /workspace ENV SHELL=/bin/zsh CMD ["/bin/zsh"]