diff --git a/docker-images/Dockerfile.agent b/docker-images/Dockerfile.agent index 30461a5..1f4d6dd 100644 --- a/docker-images/Dockerfile.agent +++ b/docker-images/Dockerfile.agent @@ -1,99 +1,107 @@ -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 \ - && 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" - -# 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", - "default_agent": "Sisyphus", - "provider": { - "local-planner": { - "npm": "@ai-sdk/openai-compatible", - "name": "GLM 4.7 (Planner)", - "options": { "baseURL": "http://host.docker.internal:9901/v1" }, - "models": { "glm": { "name": "GLM 4.7" } } - }, - "local-oracle": { - "npm": "@ai-sdk/openai-compatible", - "name": "Kimi K2.5 (Context)", - "options": { "baseURL": "http://host.docker.internal:9900/v1" }, - "models": { "kimi": { "name": "Kimi K2.5" } } - }, - "local-coder": { - "npm": "@ai-sdk/openai-compatible", - "name": "Qwen3 Next (Coder)", - "options": { "baseURL": "http://host.docker.internal:9902/v1" }, - "models": { "qwen": { "name": "Qwen3 Next" } } - } - } -} -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-planner/glm" }, - "oracle": { "model": "local-oracle/kimi" }, - "librarian": { "model": "local-oracle/kimi" }, - "build": { "model": "local-coding/qwen" } - }, - "disabled_agents": ["multimodal-looker"], - "confirm_dangerous_actions": false -} -EOF - -WORKDIR /workspace -ENV SHELL=/bin/zsh -CMD ["/bin/zsh"] \ No newline at end of file +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", + "default_agent": "Sisyphus", + "provider": { + "local-planner": { + "npm": "@ai-sdk/openai-compatible", + "name": "GLM 4.7 (Planner)", + "options": { "baseURL": "http://host.docker.internal:11434/v1" }, + "models": { "GLM-4.7-Flash-GGUF:Q6_K": { "name": "GLM-4.7-hello" } } + }, + "local-oracle": { + "npm": "@ai-sdk/openai-compatible", + "name": "Kimi K2.5 (Context)", + "options": { "baseURL": "http://host.docker.internal:11434/v1" }, + "models": { "gemma3:4b": { "name": "gemma3:4b" } } + }, + "local-coder": { + "npm": "@ai-sdk/openai-compatible", + "name": "Qwen3 Next (Coder)", + "options": { "baseURL": "http://host.docker.internal:11434/v1" }, + "models": { "qwen3-coder-next": { "name": "Qwen3 Next" } } + } + } +} +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-planner/GLM 4.7 (Planner)" }, + "oracle": { "model": "local-oracle/kimi" }, + "librarian": { "model": "local-oracle/kimi" }, + "build": { "model": "local-coder/qwen3-code-next" } + }, + "disabled_agents": ["multimodal-looker"], + "confirm_dangerous_actions": false +} +EOF + +WORKDIR /workspace +ENV SHELL=/bin/zsh +CMD ["/bin/zsh"] diff --git a/docker-images/README.md b/docker-images/README.md new file mode 100644 index 0000000..3dae9ee --- /dev/null +++ b/docker-images/README.md @@ -0,0 +1,5 @@ + +``` +docker build -t smart-agent -f Dockerfile.agent . +``` +