- Shell 31.3%
- Python 30.3%
- CSS 11.8%
- C# 9.9%
- HTML 7.7%
- Other 9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo | ||
| docs | ||
| template/dotnet-webapp-template | ||
| .dockerignore | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .repomixignore | ||
| AGENTS.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.aider | ||
| Dockerfile.base | ||
| Dockerfile.claude | ||
| Dockerfile.hermes | ||
| Dockerfile.opencode | ||
| Dockerfile.vibe | ||
| entrypoint.sh | ||
| forgejo-pr.sh | ||
| LICENSE | ||
| opencode.json.template | ||
| README.md | ||
| repomix.config.json | ||
coding-agent
A Docker image providing a sandboxed environment for AI coding agents. Supports opencode-ai, aider, Mistral Vibe CLI, Hermes Agent, and Claude Code — either all-in-one or as isolated single-agent images.
Image architecture
The project is split into a shared base image plus per-agent images:
| Dockerfile | Image | Contents |
|---|---|---|
Dockerfile.base |
coding-agent-base |
Ubuntu 24.04 + git, curl, jq, ttyd, SSH, Node.js 22, .NET 10 SDK, repomix, forgejo-pr |
Dockerfile |
coding-agent |
All agents (opencode + aider + vibe + hermes + claude) |
Dockerfile.opencode |
coding-agent-opencode |
opencode-ai only |
Dockerfile.aider |
coding-agent-aider |
aider-chat only |
Dockerfile.vibe |
coding-agent-vibe |
Mistral Vibe CLI only |
Dockerfile.hermes |
coding-agent-hermes |
Hermes Agent (Nous Research) only |
Dockerfile.claude |
coding-agent-claude |
Claude Code only |
Each agent Dockerfile is self-contained (builds from ubuntu:24.04), so you can build any image independently:
docker build -t coding-agent -f Dockerfile .
docker build -t coding-agent-opencode -f Dockerfile.opencode .
docker build -t coding-agent-aider -f Dockerfile.aider .
docker build -t coding-agent-vibe -f Dockerfile.vibe .
docker build -t coding-agent-hermes -f Dockerfile.hermes .
docker build -t coding-agent-claude -f Dockerfile.claude .
Dockerfile.base is optional — use it if you want to pre-build and cache the common layers:
docker build -t coding-agent-base -f Dockerfile.base .
docker build -t coding-agent-opencode -f Dockerfile.opencode .
With docker-compose this is handled automatically.
docker-compose — multi-service with profiles
Each agent runs as a separate service with isolated ports and volumes:
| Service | Profile | ttyd port | SSH port | Workspace |
|---|---|---|---|---|
coding-agent |
(default) | 7681 | 2222 | ./data/workspace |
opencode |
opencode |
7682 | 2223 | ./data/workspace-opencode |
aider |
aider |
7683 | 2224 | ./data/workspace-aider |
vibe |
vibe |
7684 | 2225 | ./data/workspace-vibe |
hermes |
hermes |
7685 | 2226 | ./data/workspace-hermes |
claude |
claude |
7686 | 2227 | ./data/workspace-claude |
Run a single agent
# Build all images
docker compose build
# Start only opencode
docker compose --profile opencode up -d
# Start only aider
docker compose --profile aider up -d
# Start only vibe
docker compose --profile vibe up -d
# Start only hermes
docker compose --profile hermes up -d
# Start only claude
docker compose --profile claude up -d
# Start multiple agents simultaneously
docker compose --profile opencode --profile aider up -d
Run the all-in-one (default)
docker compose up -d
Build the base image only
docker compose --profile base build
Usage
Build
docker build -t coding-agent -f Dockerfile .
Run interactively
docker run -it --rm \
-e GIT_USER_NAME="Your Name" \
-e GIT_USER_EMAIL="[email protected]" \
coding-agent
Web UI (ttyd)
When TTYD_USERNAME and TTYD_PASSWORD are set, a browser-accessible terminal is available at http://localhost:<port>.
SSH (JetBrains Gateway / remote development)
ssh root@localhost -p <ssh-port>
Set SSH_PUBLIC_KEYS in your .env to enable key-based login.
forgejo-pr
forgejo-pr --title "My PR" --head feature --base main
Environment variables
Git
| Variable | Default | Description |
|---|---|---|
GIT_USER_NAME |
— | Git user name |
GIT_USER_EMAIL |
— | Git user email |
GIT_TOKEN |
— | Git credential token (single-host, legacy) |
GIT_HOST |
— | Git host for credential storage (single-host, legacy) |
GIT_CREDENTIALS |
— | Comma-separated host:token pairs (multi-host) |
GIT_CREDENTIALStakes precedence overGIT_TOKEN+GIT_HOST.
Web UI (ttyd)
| Variable | Default | Description |
|---|---|---|
TTYD_USERNAME |
admin |
Web UI username |
TTYD_PASSWORD |
— | Web UI password (enables ttyd when set) |
SSH
| Variable | Default | Description |
|---|---|---|
SSH_PUBLIC_KEYS |
— | Public key(s) for SSH login as root. Multiple keys separated by newlines or commas. |
AI API keys
Available to all tools inside the container.
| Variable | Consumed by |
|---|---|
OPENROUTER_API_KEY |
opencode, aider, vibe, claude |
MISTRAL_API_KEY |
opencode, aider, vibe |
OPENAI_API_KEY |
opencode, aider, vibe |
ANTHROPIC_API_KEY |
opencode, aider, vibe, claude |
GOOGLE_API_KEY |
opencode, aider, vibe |
OPENCODE_API_KEY |
opencode, claude |
OLLAMA_CLOUD_API_KEY |
opencode |
PROMPTY_API_KEY |
opencode |
PROMPTY_BASE_URL |
opencode (default: http://localhost:8080/v1) |
Claude Code routing
Claude Code supports multiple providers. The entrypoint auto-configures the provider based on CLAUDE_PROVIDER or the available API keys (priority: Anthropic > OpenRouter > OpenCode Go):
| Provider | Required env vars | Auto-configured vars |
|---|---|---|
| Anthropic (direct) | ANTHROPIC_API_KEY |
none |
| OpenRouter | OPENROUTER_API_KEY (no ANTHROPIC_API_KEY) |
ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN |
| OpenCode Go | OPENCODE_API_KEY (no ANTHROPIC_API_KEY, no OPENROUTER_API_KEY) |
ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN |
| Variable | Description |
|---|---|
CLAUDE_PROVIDER |
Explicit provider selection: openrouter or opencode-go. Overrides auto-detection. |
ANTHROPIC_BASE_URL |
Override API base URL (auto-set based on provider) |
ANTHROPIC_AUTH_TOKEN |
Auth token for the API (used for OpenRouter) |
ANTHROPIC_MODEL |
Override the model used by Claude Code (optional, for non-Claude models) |
Note
: For maximum compatibility with Claude Code via OpenRouter, use "Anthropic 1P" as the preferred provider in your OpenRouter settings. Non-Claude models may not support all features (e.g., Extended Thinking, tool use).
OpenCode Go: Supports Anthropic-compatible models like Qwen3.7 Plus, Qwen3.7 Max, MiniMax M3. Set
ANTHROPIC_MODELto the model ID (e.g.,qwen3.7-plus).
The entrypoint auto-generates ~/.config/opencode/opencode.json for any provider whose env var is set (only when opencode is installed).
License
Apache 2.0 — see LICENSE.