Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e58962a72c | |||
| d2c0447147 | |||
| 77a7daf67f | |||
| b3cfe641bb | |||
| f7bd21b9fe | |||
| 1b97d98155 | |||
| de659fbc54 | |||
| d651a084de | |||
| 18b4df23e5 | |||
| 60c83568cd | |||
| a8b5f23dba | |||
| a6972becd1 | |||
| a183ad7ac6 | |||
| 017f7f1343 |
@@ -14,11 +14,18 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Force IPv4 for Docker Hub
|
||||||
|
run: |
|
||||||
|
# Prefer IPv4 to avoid intermittent IPv6 connectivity failures
|
||||||
|
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
@@ -50,11 +57,18 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Force IPv4 for Docker Hub
|
||||||
|
run: |
|
||||||
|
# Prefer IPv4 to avoid intermittent IPv6 connectivity failures
|
||||||
|
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
@@ -91,25 +105,27 @@ jobs:
|
|||||||
|
|
||||||
- name: Update Docker Hub description
|
- name: Update Docker Hub description
|
||||||
run: |
|
run: |
|
||||||
TOKEN=$(curl -s -X POST https://hub.docker.com/v2/users/login/ \
|
TOKEN=$(curl -s -X POST https://hub.docker.com/v2/auth/token \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"username":"${{ vars.DOCKERHUB_USERNAME }}","password":"${{ secrets.DOCKERHUB_TOKEN }}"}' \
|
-d '{"identifier":"${{ vars.DOCKERHUB_USERNAME }}","secret":"${{ secrets.DOCKERHUB_TOKEN }}"}' \
|
||||||
| jq -r .token)
|
| jq -r .access_token)
|
||||||
if [ "$TOKEN" = "null" ] || [ -z "$TOKEN" ]; then
|
if [ "$TOKEN" = "null" ] || [ -z "$TOKEN" ]; then
|
||||||
echo "::error::Failed to authenticate with Docker Hub API"
|
echo "::error::Failed to authenticate with Docker Hub API"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
HTTP_CODE=$(jq -n \
|
HTTP_CODE=$(jq -n \
|
||||||
--arg full "$(cat DOCKER_HUB.md)" \
|
--rawfile full DOCKER_HUB.md \
|
||||||
--arg short "Portable AI dev environment for opencode. Debian-based with git, Node.js, AWS CLI, and SSH support. Available in base and omos (multi-agent) variants." \
|
--arg short "Portable AI dev environment for opencode. Debian-based with git, Node.js, AWS CLI, and SSH support." \
|
||||||
'{"full_description": $full, "description": $short}' | \
|
'{"full_description": $full, "description": $short}' | \
|
||||||
curl -s -o /dev/null -w "%{http_code}" -X PATCH \
|
curl -s -o /tmp/hub-response.txt -w "%{http_code}" -X PATCH \
|
||||||
"https://hub.docker.com/v2/repositories/${{ vars.DOCKERHUB_USERNAME }}/opencode-devbox/" \
|
"https://hub.docker.com/v2/repositories/${{ vars.DOCKERHUB_USERNAME }}/opencode-devbox/" \
|
||||||
-H "Authorization: JWT $TOKEN" \
|
-H "Authorization: Bearer $TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d @-)
|
-d @-)
|
||||||
echo "Docker Hub API returned: $HTTP_CODE"
|
echo "Docker Hub API returned: $HTTP_CODE"
|
||||||
if [ "$HTTP_CODE" != "200" ]; then
|
if [ "$HTTP_CODE" != "200" ]; then
|
||||||
|
echo "Response body:"
|
||||||
|
cat /tmp/hub-response.txt
|
||||||
echo "::error::Docker Hub description update failed with HTTP $HTTP_CODE"
|
echo "::error::Docker Hub description update failed with HTTP $HTTP_CODE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
+160
-24
@@ -9,7 +9,7 @@ Two image variants are published for each release:
|
|||||||
| Tag | Description |
|
| Tag | Description |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `latest` / `vX.Y.Z` | Base image — opencode, Node.js, AWS CLI, dev tools |
|
| `latest` / `vX.Y.Z` | Base image — opencode, Node.js, AWS CLI, dev tools |
|
||||||
| `latest-omos` / `vX.Y.Z-omos` | Base + [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) multi-agent orchestration, Bun, and tmux |
|
| `latest-omos` / `vX.Y.Z-omos` | Base + [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) multi-agent orchestration and Bun |
|
||||||
|
|
||||||
Both variants support `linux/amd64` and `linux/arm64`.
|
Both variants support `linux/amd64` and `linux/arm64`.
|
||||||
|
|
||||||
@@ -116,10 +116,22 @@ The entrypoint automatically detects the owner of `/workspace` and adjusts the c
|
|||||||
|
|
||||||
## Initial Setup
|
## Initial Setup
|
||||||
|
|
||||||
### 1. Create a project directory
|
### 1. Create host directories
|
||||||
|
|
||||||
|
Bind-mounted directories must exist on the host before starting the container. Docker creates missing directories as root-owned, which causes permission issues.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Required
|
||||||
mkdir -p ~/projects
|
mkdir -p ~/projects
|
||||||
|
|
||||||
|
# If mounting opencode config (recommended for persistent settings)
|
||||||
|
mkdir -p ~/.config/opencode
|
||||||
|
|
||||||
|
# If using AWS Bedrock
|
||||||
|
# mkdir -p ~/.aws
|
||||||
|
|
||||||
|
# If mounting neovim config
|
||||||
|
# mkdir -p ~/.config/nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Create a `.env` file
|
### 2. Create a `.env` file
|
||||||
@@ -184,28 +196,149 @@ Understanding what survives container restarts and what doesn't:
|
|||||||
| `/home/developer/.ssh` | Host bind mount (ro) | ✅ Yes — lives on host | SSH keys |
|
| `/home/developer/.ssh` | Host bind mount (ro) | ✅ Yes — lives on host | SSH keys |
|
||||||
| `/home/developer/.aws` | Host bind mount | ✅ Yes — lives on host | AWS credentials/SSO cache |
|
| `/home/developer/.aws` | Host bind mount | ✅ Yes — lives on host | AWS credentials/SSO cache |
|
||||||
| `/home/developer/.local/share/opencode` | Named volume (if configured) | ✅ Yes — Docker volume | Session history, memory, auth tokens |
|
| `/home/developer/.local/share/opencode` | Named volume (if configured) | ✅ Yes — Docker volume | Session history, memory, auth tokens |
|
||||||
| `/home/developer/.config/opencode/opencode.json` | Generated by entrypoint | ❌ No — regenerated each start | Provider config, MCP server definitions |
|
| `/home/developer/.local/share/uv` | Named volume (if configured) | ✅ Yes — Docker volume | Python installs, uv tool installs |
|
||||||
| `/home/developer/.config/opencode/oh-my-opencode-slim.json` | Generated by entrypoint (OMOS variant) | ❌ No — regenerated each start | Agent/model mappings |
|
| `/home/developer/.rustup` | Named volume (if configured) | ✅ Yes — Docker volume | Rust toolchains |
|
||||||
|
| `/home/developer/.cargo` | Named volume (if configured) | ✅ Yes — Docker volume | Cargo binaries, registry cache |
|
||||||
|
| `/home/developer/.vscode-server` | Named volume (if configured) | ✅ Yes — Docker volume | VS Code server and extensions |
|
||||||
|
| `/home/developer/.config/opencode` | Host bind mount (if configured) | ✅ Yes — lives on host | opencode.json, oh-my-opencode-slim.json, skills |
|
||||||
|
|
||||||
### Key points
|
### Key points
|
||||||
|
|
||||||
- **Project files** (`/workspace`) are always safe — they're your host filesystem.
|
- **Project files** (`/workspace`) are always safe — they're your host filesystem.
|
||||||
- **opencode config** is auto-generated from `OPENCODE_PROVIDER` env var on each start. It only sets provider and model — no MCP servers. To persist MCP server config, mount your own config file (see Custom opencode Config below).
|
- **opencode config** is auto-generated from `OPENCODE_PROVIDER` env var on each start if no existing config is found. To persist config changes, mount the config directory from the host (see Custom opencode Config below).
|
||||||
- **opencode data** (session history, memory) is lost with `--rm` unless you add a named volume.
|
- **opencode data** (session history, memory) is lost with `--rm` unless you add a named volume.
|
||||||
|
- **Python installs** via `uv python install` are lost unless you add the `devbox-uv` named volume.
|
||||||
|
- **Rust toolchains** via `rustup-init` are lost unless you add the `devbox-rustup` and `devbox-cargo` named volumes.
|
||||||
- **AWS SSO tokens** persist across restarts when `~/.aws` is mounted (recommended for Bedrock users).
|
- **AWS SSO tokens** persist across restarts when `~/.aws` is mounted (recommended for Bedrock users).
|
||||||
|
|
||||||
## Custom opencode Config
|
## Custom opencode Config
|
||||||
|
|
||||||
For full control (MCP servers, custom models, keybindings), mount your own config:
|
For full control over opencode settings (MCP servers, custom models, oh-my-opencode-slim agents, etc.), mount the entire config directory from the host:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -it --rm \
|
docker run -it --rm \
|
||||||
-v ./my-opencode.json:/home/developer/.config/opencode/opencode.json:ro \
|
-v ~/.config/opencode:/home/developer/.config/opencode \
|
||||||
... \
|
... \
|
||||||
joakimp/opencode-devbox:latest
|
joakimp/opencode-devbox:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
When a config file is mounted, the `OPENCODE_PROVIDER` auto-config is skipped.
|
This persists all configuration changes across container restarts. When an existing `opencode.json` is found, the `OPENCODE_PROVIDER` auto-config is skipped.
|
||||||
|
|
||||||
|
## Neovim Configuration
|
||||||
|
|
||||||
|
The image includes neovim 0.12 with `EDITOR=nvim` set by default. To use your own neovim config (and have plugins auto-install via lazy.nvim on first start), mount it from the host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it --rm \
|
||||||
|
-v ~/.config/nvim:/home/developer/.config/nvim:ro \
|
||||||
|
... \
|
||||||
|
joakimp/opencode-devbox:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## Python Development with uv
|
||||||
|
|
||||||
|
The image includes [uv](https://docs.astral.sh/uv/), a fast Python package manager that replaces pip, venv, and pyenv. Python is not pre-installed but can be installed on demand:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install Python (persists across restarts with devbox-uv volume)
|
||||||
|
uv python install 3.12
|
||||||
|
|
||||||
|
# Create a virtual environment and install dependencies
|
||||||
|
uv venv
|
||||||
|
uv pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Or use uv's project workflow (reads pyproject.toml)
|
||||||
|
uv sync
|
||||||
|
|
||||||
|
# Run a Python script
|
||||||
|
uv run python script.py
|
||||||
|
|
||||||
|
# Install standalone Python tools
|
||||||
|
uvx ruff check .
|
||||||
|
```
|
||||||
|
|
||||||
|
To persist Python installs across container restarts, add a named volume:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it --rm \
|
||||||
|
-v devbox-uv:/home/developer/.local/share/uv \
|
||||||
|
... \
|
||||||
|
joakimp/opencode-devbox:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Project virtual environments (`.venv`) are stored in your workspace directory and persist automatically via the `/workspace` bind mount.
|
||||||
|
|
||||||
|
## Rust Development with rustup
|
||||||
|
|
||||||
|
The image includes `rustup-init`, the Rust toolchain installer. Rust is not pre-installed but can be bootstrapped on demand:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# One-time setup: install Rust toolchain (~300MB, persists with volumes)
|
||||||
|
rustup-init -y
|
||||||
|
source ~/.cargo/env
|
||||||
|
|
||||||
|
# Now use Rust normally
|
||||||
|
cargo new my-project
|
||||||
|
cargo build
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
|
|
||||||
|
To persist Rust toolchains and cargo data across container restarts, add named volumes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it --rm \
|
||||||
|
-v devbox-rustup:/home/developer/.rustup \
|
||||||
|
-v devbox-cargo:/home/developer/.cargo \
|
||||||
|
... \
|
||||||
|
joakimp/opencode-devbox:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## JavaScript and TypeScript
|
||||||
|
|
||||||
|
The base image includes **Node.js 22** and **npm** — sufficient for most JavaScript and TypeScript development:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Initialize a new project
|
||||||
|
npm init -y
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# Run TypeScript (via tsx, ts-node, etc.)
|
||||||
|
npx tsx src/index.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
The OMOS image variant also includes **Bun**, a faster JavaScript runtime and package manager:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun init
|
||||||
|
bun install
|
||||||
|
bun run src/index.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
Node modules are stored in your project directory under `/workspace` and persist automatically.
|
||||||
|
|
||||||
|
## VS Code Integration
|
||||||
|
|
||||||
|
VS Code can connect directly to a running opencode-devbox container for a full IDE experience with IntelliSense, debugging, and extensions running inside the container.
|
||||||
|
|
||||||
|
**Requirements:** Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. For remote Docker hosts, also install [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh).
|
||||||
|
|
||||||
|
**Steps:**
|
||||||
|
|
||||||
|
1. Start the container: `docker compose up -d`
|
||||||
|
2. In VS Code: `Ctrl+Shift+P` → "Dev Containers: Attach to Running Container" → select `opencode-devbox`
|
||||||
|
|
||||||
|
For remote Docker hosts (e.g. connecting to a server via SSH), first connect to the remote host with Remote-SSH, then attach to the container from there.
|
||||||
|
|
||||||
|
VS Code extensions installed inside the container persist as long as the container exists. For persistent extension storage across container recreations, add a named volume:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it --rm \
|
||||||
|
-v devbox-vscode:/home/developer/.vscode-server \
|
||||||
|
... \
|
||||||
|
joakimp/opencode-devbox:latest
|
||||||
|
```
|
||||||
|
|
||||||
## Using docker-compose
|
## Using docker-compose
|
||||||
|
|
||||||
@@ -244,16 +377,28 @@ services:
|
|||||||
- ~/projects:/workspace
|
- ~/projects:/workspace
|
||||||
- ~/.ssh:/home/developer/.ssh:ro
|
- ~/.ssh:/home/developer/.ssh:ro
|
||||||
- devbox-data:/home/developer/.local/share/opencode
|
- devbox-data:/home/developer/.local/share/opencode
|
||||||
|
# Optional: persist Python/uv installs across restarts
|
||||||
|
# - devbox-uv:/home/developer/.local/share/uv
|
||||||
|
# Optional: persist Rust toolchains and cargo data
|
||||||
|
# - devbox-rustup:/home/developer/.rustup
|
||||||
|
# - devbox-cargo:/home/developer/.cargo
|
||||||
|
# Optional: persist VS Code server and extensions
|
||||||
|
# - devbox-vscode:/home/developer/.vscode-server
|
||||||
# Mount AWS config for Bedrock SSO (required for amazon-bedrock provider)
|
# Mount AWS config for Bedrock SSO (required for amazon-bedrock provider)
|
||||||
# - ~/.aws:/home/developer/.aws
|
# - ~/.aws:/home/developer/.aws
|
||||||
# Optional: mount your own opencode config (MCP servers, custom models, etc.)
|
# Optional: mount opencode config directory (persists config changes across restarts)
|
||||||
# - ./opencode.json:/home/developer/.config/opencode/opencode.json:ro
|
# - ~/.config/opencode:/home/developer/.config/opencode
|
||||||
# Optional: mount opencode skills from host
|
# Optional: mount opencode agent skills from host
|
||||||
# - ~/.config/opencode/skills:/home/developer/.config/opencode/skills:ro
|
|
||||||
# - ~/.agents/skills:/home/developer/.agents/skills:ro
|
# - ~/.agents/skills:/home/developer/.agents/skills:ro
|
||||||
|
# Optional: mount neovim config from host (plugins auto-install on first start)
|
||||||
|
# - ~/.config/nvim:/home/developer/.config/nvim:ro
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
devbox-data:
|
devbox-data:
|
||||||
|
# devbox-uv:
|
||||||
|
# devbox-rustup:
|
||||||
|
# devbox-cargo:
|
||||||
|
# devbox-vscode:
|
||||||
```
|
```
|
||||||
|
|
||||||
Docker Compose loads `.env` automatically from the same directory. All variables from `.env` are passed to the container via `env_file`. Do **not** hardcode provider settings in the `environment:` section — use `.env` instead.
|
Docker Compose loads `.env` automatically from the same directory. All variables from `.env` are passed to the container via `env_file`. Do **not** hardcode provider settings in the `environment:` section — use `.env` instead.
|
||||||
@@ -283,11 +428,11 @@ docker compose run --rm devbox bash # interactive shell
|
|||||||
|
|
||||||
### Base image (`latest`)
|
### Base image (`latest`)
|
||||||
|
|
||||||
- **Debian bookworm-slim** — glibc, full terminal/PTY support
|
- **Debian trixie-slim** — glibc, full terminal/PTY support
|
||||||
- **opencode** — AI coding assistant
|
- **opencode** — AI coding assistant
|
||||||
- **Node.js 22** — for npx-based MCP servers
|
- **Node.js 22** — for npx-based MCP servers
|
||||||
- **AWS CLI v2** — SSO and Bedrock authentication
|
- **AWS CLI v2** — SSO and Bedrock authentication
|
||||||
- **Dev tools** — git, git-lfs, ssh, ripgrep, fd, fzf, jq, curl, wget, vim, tree
|
- **Dev tools** — git, git-lfs, ssh, ripgrep, fd, fzf, bat, eza, zoxide, uv, rustup, jq, make, curl, wget, neovim 0.12, tmux, htop, tree
|
||||||
- **Non-root user** — runs as `developer` with UID auto-matched to workspace owner (sudo available)
|
- **Non-root user** — runs as `developer` with UID auto-matched to workspace owner (sudo available)
|
||||||
|
|
||||||
### OMOS image (`latest-omos`)
|
### OMOS image (`latest-omos`)
|
||||||
@@ -296,7 +441,6 @@ Everything in the base image, plus:
|
|||||||
|
|
||||||
- **[oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim)** — multi-agent orchestration plugin
|
- **[oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim)** — multi-agent orchestration plugin
|
||||||
- **Bun** — JavaScript runtime required by oh-my-opencode-slim
|
- **Bun** — JavaScript runtime required by oh-my-opencode-slim
|
||||||
- **tmux** — terminal multiplexer (used by OMOS for agent pane integration, but also useful on its own for managing multiple terminal sessions)
|
|
||||||
- **6 specialized agents** — Orchestrator, Explorer, Oracle, Librarian, Designer, Fixer
|
- **6 specialized agents** — Orchestrator, Explorer, Oracle, Librarian, Designer, Fixer
|
||||||
|
|
||||||
### Additional runtimes (build from source)
|
### Additional runtimes (build from source)
|
||||||
@@ -335,15 +479,7 @@ On first start, the entrypoint configures oh-my-opencode-slim automatically. The
|
|||||||
|
|
||||||
### Custom OMOS configuration
|
### Custom OMOS configuration
|
||||||
|
|
||||||
Mount your own config to control which models power each agent:
|
If you mount the opencode config directory (see Custom opencode Config above), the `oh-my-opencode-slim.json` file is included and persists across restarts. Edit it directly to control which models power each agent, fallback chains, council setup, and more.
|
||||||
|
|
||||||
```bash
|
|
||||||
docker run -it --rm \
|
|
||||||
-e ENABLE_OMOS=true \
|
|
||||||
-v ./oh-my-opencode-slim.json:/home/developer/.config/opencode/oh-my-opencode-slim.json:ro \
|
|
||||||
... \
|
|
||||||
joakimp/opencode-devbox:latest-omos
|
|
||||||
```
|
|
||||||
|
|
||||||
See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference.
|
See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference.
|
||||||
|
|
||||||
|
|||||||
+52
-5
@@ -1,7 +1,7 @@
|
|||||||
# opencode-devbox — portable AI dev environment
|
# opencode-devbox — portable AI dev environment
|
||||||
# Debian-based container with opencode and configurable dev tools
|
# Debian-based container with opencode and configurable dev tools
|
||||||
|
|
||||||
ARG DEBIAN_VERSION=bookworm-slim
|
ARG DEBIAN_VERSION=trixie-slim
|
||||||
FROM debian:${DEBIAN_VERSION} AS base
|
FROM debian:${DEBIAN_VERSION} AS base
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
@@ -27,7 +27,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
fd-find \
|
fd-find \
|
||||||
tree \
|
tree \
|
||||||
less \
|
less \
|
||||||
vim-tiny \
|
htop \
|
||||||
|
tmux \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
diffutils \
|
||||||
sudo \
|
sudo \
|
||||||
locales \
|
locales \
|
||||||
procps \
|
procps \
|
||||||
@@ -59,11 +63,56 @@ RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "amd64" ;; arm64) echo "arm64" ;;
|
|||||||
git lfs install --system && \
|
git lfs install --system && \
|
||||||
git-lfs --version
|
git-lfs --version
|
||||||
|
|
||||||
|
# neovim — modern text editor (pre-built release from GitHub)
|
||||||
|
ARG NVIM_VERSION=0.12.1
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "arm64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
curl -fsSL "https://github.com/neovim/neovim/releases/download/v${NVIM_VERSION}/nvim-linux-${ARCH}.tar.gz" | tar -xz -C /opt && \
|
||||||
|
ln -s /opt/nvim-linux-${ARCH}/bin/nvim /usr/local/bin/nvim && \
|
||||||
|
nvim --version | head -1
|
||||||
|
|
||||||
|
# bat — syntax-highlighted cat replacement
|
||||||
|
ARG BAT_VERSION=0.25.0
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
curl -fsSL "https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/bat-v${BAT_VERSION}-${ARCH}-unknown-linux-musl.tar.gz" | tar -xz -C /tmp && \
|
||||||
|
install /tmp/bat-v${BAT_VERSION}-${ARCH}-unknown-linux-musl/bat /usr/local/bin/bat && \
|
||||||
|
rm -rf /tmp/bat-v${BAT_VERSION}-* && \
|
||||||
|
bat --version
|
||||||
|
|
||||||
|
# eza — modern ls replacement
|
||||||
|
ARG EZA_VERSION=0.23.4
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
curl -fsSL "https://github.com/eza-community/eza/releases/download/v${EZA_VERSION}/eza_${ARCH}-unknown-linux-gnu.tar.gz" | tar -xz -C /usr/local/bin && \
|
||||||
|
eza --version | head -1
|
||||||
|
|
||||||
|
# zoxide — smarter cd command
|
||||||
|
ARG ZOXIDE_VERSION=0.9.9
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
curl -fsSL "https://github.com/ajeetdsouza/zoxide/releases/download/v${ZOXIDE_VERSION}/zoxide-${ZOXIDE_VERSION}-${ARCH}-unknown-linux-musl.tar.gz" | tar -xz -C /usr/local/bin zoxide && \
|
||||||
|
zoxide --version
|
||||||
|
|
||||||
|
# uv — fast Python package manager (replaces pip, venv, pyenv)
|
||||||
|
ARG UV_VERSION=0.11.6
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
curl -fsSL "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-${ARCH}-unknown-linux-musl.tar.gz" | tar -xz -C /tmp && \
|
||||||
|
install /tmp/uv-${ARCH}-unknown-linux-musl/uv /usr/local/bin/uv && \
|
||||||
|
install /tmp/uv-${ARCH}-unknown-linux-musl/uvx /usr/local/bin/uvx && \
|
||||||
|
rm -rf /tmp/uv-* && \
|
||||||
|
uv --version
|
||||||
|
|
||||||
|
# rustup — Rust toolchain manager
|
||||||
|
# Installs the rustup-init binary only. Users bootstrap Rust with:
|
||||||
|
# rustup-init -y && source ~/.cargo/env
|
||||||
|
# Toolchains persist via devbox-rustup and devbox-cargo volumes.
|
||||||
|
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64" ;; *) echo "x86_64" ;; esac) && \
|
||||||
|
curl -fsSL "https://static.rust-lang.org/rustup/dist/${ARCH}-unknown-linux-gnu/rustup-init" -o /usr/local/bin/rustup-init && \
|
||||||
|
chmod +x /usr/local/bin/rustup-init
|
||||||
|
|
||||||
# Set locale
|
# Set locale
|
||||||
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
||||||
ENV LANG=en_US.UTF-8
|
ENV LANG=en_US.UTF-8
|
||||||
ENV LANGUAGE=en_US:en
|
ENV LANGUAGE=en_US:en
|
||||||
ENV LC_ALL=en_US.UTF-8
|
ENV LC_ALL=en_US.UTF-8
|
||||||
|
ENV EDITOR=nvim
|
||||||
|
|
||||||
# ── Node.js (required for opencode v1.x install + MCP servers) ──────
|
# ── Node.js (required for opencode v1.x install + MCP servers) ──────
|
||||||
ARG NODE_VERSION=22
|
ARG NODE_VERSION=22
|
||||||
@@ -107,13 +156,11 @@ RUN if [ "${INSTALL_GO}" = "true" ]; then \
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Optional: oh-my-opencode-slim (multi-agent orchestration) ────────
|
# ── Optional: oh-my-opencode-slim (multi-agent orchestration) ────────
|
||||||
# Installs Bun runtime, tmux, and the oh-my-opencode-slim npm package.
|
# Installs Bun runtime and the oh-my-opencode-slim npm package.
|
||||||
# Runtime activation is controlled by ENABLE_OMOS env var in entrypoint.
|
# Runtime activation is controlled by ENABLE_OMOS env var in entrypoint.
|
||||||
ARG INSTALL_OMOS=false
|
ARG INSTALL_OMOS=false
|
||||||
ARG OMOS_VERSION=latest
|
ARG OMOS_VERSION=latest
|
||||||
RUN if [ "${INSTALL_OMOS}" = "true" ]; then \
|
RUN if [ "${INSTALL_OMOS}" = "true" ]; then \
|
||||||
apt-get update && apt-get install -y --no-install-recommends tmux && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local bash && \
|
curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local bash && \
|
||||||
bun --version && \
|
bun --version && \
|
||||||
npm install -g oh-my-opencode-slim@${OMOS_VERSION}; \
|
npm install -g oh-my-opencode-slim@${OMOS_VERSION}; \
|
||||||
|
|||||||
@@ -27,19 +27,33 @@ docker compose run --rm devbox
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Debian bookworm** base — glibc, full PTY/terminal support
|
- **Debian trixie** base — glibc, full PTY/terminal support
|
||||||
- **Configurable providers** — Anthropic, OpenAI, AWS Bedrock via env vars
|
- **Configurable providers** — Anthropic, OpenAI, AWS Bedrock via env vars
|
||||||
- **Host filesystem access** — bind mount any directory as `/workspace`
|
- **Host filesystem access** — bind mount any directory as `/workspace`
|
||||||
- **SSH key forwarding** — git push/pull to private repos
|
- **SSH key forwarding** — git push/pull to private repos
|
||||||
- **MCP server support** — Node.js included for `npx`-based MCP servers
|
- **MCP server support** — Node.js included for `npx`-based MCP servers
|
||||||
- **Non-root user** — runs as `developer` with UID auto-matched to workspace owner (sudo available)
|
- **Non-root user** — runs as `developer` with UID auto-matched to workspace owner (sudo available)
|
||||||
- **Optional runtimes** — Python, Go via build args (Node.js always included — required for opencode v1.x)
|
- **Python via uv** — `uv` package manager included; install Python on demand with `uv python install`
|
||||||
|
- **Rust via rustup** — `rustup-init` included; bootstrap Rust on demand with `rustup-init -y`
|
||||||
|
- **Optional runtimes** — Python (apt), Go via build args (Node.js always included — required for opencode v1.x)
|
||||||
- **Multi-agent orchestration** — optional [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) integration via build arg
|
- **Multi-agent orchestration** — optional [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) integration via build arg
|
||||||
- **AWS CLI v2** — built-in SSO/Bedrock authentication with headless device-code flow
|
- **AWS CLI v2** — built-in SSO/Bedrock authentication with headless device-code flow
|
||||||
- **Multi-arch** — amd64 and arm64
|
- **Multi-arch** — amd64 and arm64
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
Bind-mounted directories must exist on the host before starting the container. Docker creates missing directories as root-owned, which causes permission issues.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Required: workspace for your projects
|
||||||
|
mkdir -p ~/projects
|
||||||
|
|
||||||
|
# If mounting opencode config (recommended for persistent settings)
|
||||||
|
mkdir -p ~/.config/opencode
|
||||||
|
```
|
||||||
|
|
||||||
### Connecting to the container
|
### Connecting to the container
|
||||||
|
|
||||||
From your laptop, SSH into the remote server where Docker is running, then start the container:
|
From your laptop, SSH into the remote server where Docker is running, then start the container:
|
||||||
@@ -110,23 +124,146 @@ docker compose exec -u developer devbox aws --version
|
|||||||
|
|
||||||
### Custom opencode config
|
### Custom opencode config
|
||||||
|
|
||||||
Mount your own `opencode.json` for full control (MCP servers, custom models, etc.):
|
For full control over opencode settings (MCP servers, custom models, oh-my-opencode-slim agents, etc.), mount the entire config directory from the host:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
volumes:
|
volumes:
|
||||||
- ./my-opencode.json:/home/developer/.config/opencode/opencode.json:ro
|
- ~/.config/opencode:/home/developer/.config/opencode
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This persists all configuration changes across container restarts, including `opencode.json`, `oh-my-opencode-slim.json`, and skills. When an existing `opencode.json` is found, the `OPENCODE_PROVIDER` auto-config is skipped.
|
||||||
|
|
||||||
### Custom skills
|
### Custom skills
|
||||||
|
|
||||||
Mount your host's opencode skills into the container:
|
Mount agent skills from the host:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
volumes:
|
volumes:
|
||||||
- ~/.config/opencode/skills:/home/developer/.config/opencode/skills:ro
|
|
||||||
- ~/.agents/skills:/home/developer/.agents/skills:ro
|
- ~/.agents/skills:/home/developer/.agents/skills:ro
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Neovim configuration
|
||||||
|
|
||||||
|
The image includes neovim 0.12 with `EDITOR=nvim` set by default. To use your own neovim config (and have plugins auto-install via lazy.nvim on first start), mount it from the host:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
volumes:
|
||||||
|
- ~/.config/nvim:/home/developer/.config/nvim:ro
|
||||||
|
```
|
||||||
|
|
||||||
|
### Python development with uv
|
||||||
|
|
||||||
|
The image includes [uv](https://docs.astral.sh/uv/), a fast Python package manager that replaces pip, venv, and pyenv. Python is not pre-installed but can be installed on demand:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install Python (persists across restarts with devbox-uv volume)
|
||||||
|
uv python install 3.12
|
||||||
|
|
||||||
|
# Create a virtual environment and install dependencies
|
||||||
|
uv venv
|
||||||
|
uv pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Or use uv's project workflow (reads pyproject.toml)
|
||||||
|
uv sync
|
||||||
|
|
||||||
|
# Run a Python script
|
||||||
|
uv run python script.py
|
||||||
|
|
||||||
|
# Install standalone Python tools
|
||||||
|
uvx ruff check .
|
||||||
|
```
|
||||||
|
|
||||||
|
Python installations are stored in `~/.local/share/uv/`. To persist them across container restarts, add the `devbox-uv` named volume to your `docker-compose.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
volumes:
|
||||||
|
- devbox-uv:/home/developer/.local/share/uv
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
devbox-uv:
|
||||||
|
```
|
||||||
|
|
||||||
|
Project virtual environments (`.venv`) are stored in your workspace directory and persist automatically via the `/workspace` bind mount.
|
||||||
|
|
||||||
|
### Rust development with rustup
|
||||||
|
|
||||||
|
The image includes `rustup-init`, the Rust toolchain installer. Rust is not pre-installed but can be bootstrapped on demand:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# One-time setup: install Rust toolchain (~300MB, persists with volumes)
|
||||||
|
rustup-init -y
|
||||||
|
source ~/.cargo/env
|
||||||
|
|
||||||
|
# Now use Rust normally
|
||||||
|
cargo new my-project
|
||||||
|
cargo build
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
|
|
||||||
|
To persist Rust toolchains and cargo data across container restarts, add named volumes to your `docker-compose.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
volumes:
|
||||||
|
- devbox-rustup:/home/developer/.rustup
|
||||||
|
- devbox-cargo:/home/developer/.cargo
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
devbox-rustup:
|
||||||
|
devbox-cargo:
|
||||||
|
```
|
||||||
|
|
||||||
|
### JavaScript and TypeScript
|
||||||
|
|
||||||
|
The base image includes **Node.js 22** and **npm** — sufficient for most JavaScript and TypeScript development:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Initialize a new project
|
||||||
|
npm init -y
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# Run TypeScript (via tsx, ts-node, etc.)
|
||||||
|
npx tsx src/index.ts
|
||||||
|
|
||||||
|
# Use npx for one-off tools
|
||||||
|
npx tsc --init
|
||||||
|
```
|
||||||
|
|
||||||
|
The OMOS image variant also includes **Bun**, a faster JavaScript runtime and package manager:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun init
|
||||||
|
bun install
|
||||||
|
bun run src/index.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
Node modules are stored in your project directory under `/workspace` and persist automatically.
|
||||||
|
|
||||||
|
### VS Code integration
|
||||||
|
|
||||||
|
VS Code can connect directly to a running opencode-devbox container for a full IDE experience with IntelliSense, debugging, and extensions running inside the container.
|
||||||
|
|
||||||
|
**Local Docker (Docker running on your workstation):**
|
||||||
|
|
||||||
|
1. Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension
|
||||||
|
2. Start the container: `docker compose up -d`
|
||||||
|
3. In VS Code: `Ctrl+Shift+P` → "Dev Containers: Attach to Running Container" → select `opencode-devbox`
|
||||||
|
|
||||||
|
**Remote Docker (Docker running on a remote server, e.g. via SSH):**
|
||||||
|
|
||||||
|
1. Install the [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) and [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extensions
|
||||||
|
2. Connect to the remote host: `Ctrl+Shift+P` → "Remote-SSH: Connect to Host"
|
||||||
|
3. On the remote host, start the container: `docker compose up -d`
|
||||||
|
4. In VS Code (now connected to the remote): `Ctrl+Shift+P` → "Dev Containers: Attach to Running Container"
|
||||||
|
|
||||||
|
VS Code extensions installed inside the container persist as long as the container exists (not removed with `docker compose down`). For persistent extension storage across container recreations, add a named volume:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
volumes:
|
||||||
|
- devbox-vscode:/home/developer/.vscode-server
|
||||||
|
```
|
||||||
|
|
||||||
### Rebuilding the Image
|
### Rebuilding the Image
|
||||||
|
|
||||||
`docker compose run` and `docker compose up` use the existing image — they **do not rebuild** when you change the Dockerfile or build args (e.g. updating `OPENCODE_VERSION`). Rebuild explicitly:
|
`docker compose run` and `docker compose up` use the existing image — they **do not rebuild** when you change the Dockerfile or build args (e.g. updating `OPENCODE_VERSION`). Rebuild explicitly:
|
||||||
@@ -153,7 +290,7 @@ docker compose build --build-arg OPENCODE_VERSION=1.5.0
|
|||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `INSTALL_PYTHON` | `false` | Python 3 + pip + venv |
|
| `INSTALL_PYTHON` | `false` | Python 3 + pip + venv |
|
||||||
| `INSTALL_GO` | `false` | Go toolchain |
|
| `INSTALL_GO` | `false` | Go toolchain |
|
||||||
| `INSTALL_OMOS` | `false` | [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) multi-agent orchestration (installs Bun, tmux, and plugin) |
|
| `INSTALL_OMOS` | `false` | [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) multi-agent orchestration (installs Bun and plugin) |
|
||||||
| `OMOS_VERSION` | `latest` | Pin a specific oh-my-opencode-slim version |
|
| `OMOS_VERSION` | `latest` | Pin a specific oh-my-opencode-slim version |
|
||||||
|
|
||||||
## oh-my-opencode-slim (Multi-Agent Orchestration)
|
## oh-my-opencode-slim (Multi-Agent Orchestration)
|
||||||
@@ -170,7 +307,7 @@ A pre-built OMOS image is available on Docker Hub as `joakimp/opencode-devbox:la
|
|||||||
docker compose build --build-arg INSTALL_OMOS=true
|
docker compose build --build-arg INSTALL_OMOS=true
|
||||||
```
|
```
|
||||||
|
|
||||||
This installs Bun, tmux, and the oh-my-opencode-slim package into the image.
|
This installs Bun and the oh-my-opencode-slim package into the image.
|
||||||
|
|
||||||
**2. Enable in `.env`:**
|
**2. Enable in `.env`:**
|
||||||
|
|
||||||
@@ -191,20 +328,15 @@ On first start, the entrypoint runs the oh-my-opencode-slim installer in non-int
|
|||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `ENABLE_OMOS` | `false` | Activate oh-my-opencode-slim on container start |
|
| `ENABLE_OMOS` | `false` | Activate oh-my-opencode-slim on container start |
|
||||||
| `OMOS_TMUX` | `false` | Enable tmux pane integration (tmux is included with `INSTALL_OMOS`) |
|
| `OMOS_TMUX` | `false` | Enable tmux pane integration (tmux is included in the base image) |
|
||||||
| `OMOS_SKILLS` | `true` | Install recommended skills (simplify, agent-browser, cartography) |
|
| `OMOS_SKILLS` | `true` | Install recommended skills (simplify, agent-browser, cartography) |
|
||||||
| `OMOS_RESET` | `false` | Force regenerate config on next start (backs up existing config) |
|
| `OMOS_RESET` | `false` | Force regenerate config on next start (backs up existing config) |
|
||||||
|
|
||||||
### Custom Configuration
|
### Custom Configuration
|
||||||
|
|
||||||
You can mount your own oh-my-opencode-slim config instead of using the auto-generated one:
|
If you mount the opencode config directory (see Custom opencode config above), the `oh-my-opencode-slim.json` file is included and persists across restarts. Edit it directly to control which models power each agent, fallback chains, council setup, and more.
|
||||||
|
|
||||||
```yaml
|
See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference.
|
||||||
volumes:
|
|
||||||
- ./oh-my-opencode-slim.json:/home/developer/.config/opencode/oh-my-opencode-slim.json:ro
|
|
||||||
```
|
|
||||||
|
|
||||||
The config file controls which models power each agent, fallback chains, council setup, and more. See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference.
|
|
||||||
|
|
||||||
### Verifying Agents
|
### Verifying Agents
|
||||||
|
|
||||||
@@ -301,14 +433,14 @@ Host Machine
|
|||||||
├── ~/.aws ──bind mount──▶ /home/developer/.aws (Bedrock SSO)
|
├── ~/.aws ──bind mount──▶ /home/developer/.aws (Bedrock SSO)
|
||||||
└── .env ──env vars───▶ provider config + API keys
|
└── .env ──env vars───▶ provider config + API keys
|
||||||
|
|
||||||
Container (Debian bookworm)
|
Container (Debian trixie)
|
||||||
├── opencode binary
|
├── opencode binary
|
||||||
├── oh-my-opencode-slim (optional — multi-agent orchestration plugin, includes Bun + tmux)
|
├── oh-my-opencode-slim (optional — multi-agent orchestration plugin, includes Bun)
|
||||||
├── AWS CLI v2 (SSO + Bedrock auth)
|
├── AWS CLI v2 (SSO + Bedrock auth)
|
||||||
├── git, ssh, ripgrep, fd, jq, curl, fzf
|
├── neovim 0.12, tmux, htop, bat, eza, zoxide, uv, rustup, make
|
||||||
|
├── git, ssh, ripgrep, fd, fzf, jq, curl, tree
|
||||||
├── Node.js (for MCP servers)
|
├── Node.js (for MCP servers)
|
||||||
├── Bun (optional — included with oh-my-opencode-slim)
|
├── Bun (optional — included with oh-my-opencode-slim)
|
||||||
├── tmux (optional — included with oh-my-opencode-slim, also useful independently)
|
|
||||||
├── entrypoint.sh (UID adjustment, git config, provider setup)
|
├── entrypoint.sh (UID adjustment, git config, provider setup)
|
||||||
└── /workspace ← your code lives here
|
└── /workspace ← your code lives here
|
||||||
```
|
```
|
||||||
@@ -321,10 +453,13 @@ Container (Debian bookworm)
|
|||||||
| `/home/developer/.ssh` | Host bind mount (ro) | ✅ Yes | SSH keys |
|
| `/home/developer/.ssh` | Host bind mount (ro) | ✅ Yes | SSH keys |
|
||||||
| `/home/developer/.aws` | Host bind mount (if configured) | ✅ Yes | AWS credentials/SSO cache |
|
| `/home/developer/.aws` | Host bind mount (if configured) | ✅ Yes | AWS credentials/SSO cache |
|
||||||
| `/home/developer/.local/share/opencode` | Named volume `devbox-data` | ✅ Yes | Session history, memory |
|
| `/home/developer/.local/share/opencode` | Named volume `devbox-data` | ✅ Yes | Session history, memory |
|
||||||
| `/home/developer/.config/opencode/opencode.json` | Generated by entrypoint | ❌ No | Provider/model config |
|
| `/home/developer/.local/share/uv` | Named volume `devbox-uv` (if configured) | ✅ Yes | Python installs, uv tool installs |
|
||||||
| `/home/developer/.config/opencode/oh-my-opencode-slim.json` | Generated by entrypoint (if OMOS enabled) | ❌ No | Agent/model mappings |
|
| `/home/developer/.rustup` | Named volume `devbox-rustup` (if configured) | ✅ Yes | Rust toolchains |
|
||||||
|
| `/home/developer/.cargo` | Named volume `devbox-cargo` (if configured) | ✅ Yes | Cargo binaries, registry cache |
|
||||||
|
| `/home/developer/.vscode-server` | Named volume `devbox-vscode` (if configured) | ✅ Yes | VS Code server and extensions |
|
||||||
|
| `/home/developer/.config/opencode` | Host bind mount (if configured) | ✅ Yes | opencode.json, oh-my-opencode-slim.json, skills |
|
||||||
|
|
||||||
**opencode config** (`opencode.json`) is auto-generated from `OPENCODE_PROVIDER` on each start. It sets provider and model only — no MCP servers. To use MCP servers or custom settings, mount your own config file (see Custom opencode config above).
|
**opencode config** (`opencode.json`) is auto-generated from `OPENCODE_PROVIDER` on each start. It sets provider and model only — no MCP servers. To persist config changes and use custom settings, mount the config directory from the host (see Custom opencode config above).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
+23
-6
@@ -31,21 +31,38 @@ services:
|
|||||||
# SSH keys (read-only) — for git push/pull
|
# SSH keys (read-only) — for git push/pull
|
||||||
- ${SSH_KEY_PATH:-~/.ssh}:/home/developer/.ssh:ro
|
- ${SSH_KEY_PATH:-~/.ssh}:/home/developer/.ssh:ro
|
||||||
|
|
||||||
# Optional: mount your own opencode config (MCP servers, custom models, etc.)
|
# Optional: mount opencode config directory (persists config changes across restarts)
|
||||||
# - ./opencode.json:/home/developer/.config/opencode/opencode.json:ro
|
# Includes opencode.json, oh-my-opencode-slim.json, skills, etc.
|
||||||
|
# When mounted, OPENCODE_PROVIDER auto-config is skipped if opencode.json exists.
|
||||||
|
# - ~/.config/opencode:/home/developer/.config/opencode
|
||||||
|
|
||||||
# Optional: mount opencode skills from host
|
# Optional: mount opencode agent skills from host
|
||||||
# - ~/.config/opencode/skills:/home/developer/.config/opencode/skills:ro
|
|
||||||
# - ~/.agents/skills:/home/developer/.agents/skills:ro
|
# - ~/.agents/skills:/home/developer/.agents/skills:ro
|
||||||
|
|
||||||
# Optional: mount your own oh-my-opencode-slim config
|
# Optional: mount neovim config from host (plugins auto-install on first start)
|
||||||
# - ./oh-my-opencode-slim.json:/home/developer/.config/opencode/oh-my-opencode-slim.json:ro
|
# - ~/.config/nvim:/home/developer/.config/nvim:ro
|
||||||
|
|
||||||
# Optional: persist opencode data (auth, memory, etc.)
|
# Optional: persist opencode data (auth, memory, etc.)
|
||||||
- devbox-data:/home/developer/.local/share/opencode
|
- devbox-data:/home/developer/.local/share/opencode
|
||||||
|
|
||||||
|
# Optional: persist uv data (Python installs, tool installs)
|
||||||
|
# Without this, 'uv python install' must be re-run after container removal.
|
||||||
|
- devbox-uv:/home/developer/.local/share/uv
|
||||||
|
|
||||||
|
# Optional: persist Rust toolchains and cargo data
|
||||||
|
# Without this, 'rustup-init' must be re-run after container removal.
|
||||||
|
# - devbox-rustup:/home/developer/.rustup
|
||||||
|
# - devbox-cargo:/home/developer/.cargo
|
||||||
|
|
||||||
|
# Optional: persist VS Code server and extensions across container recreations
|
||||||
|
# - devbox-vscode:/home/developer/.vscode-server
|
||||||
|
|
||||||
# Optional: AWS credentials/SSO config (not read-only — SSO writes token cache)
|
# Optional: AWS credentials/SSO config (not read-only — SSO writes token cache)
|
||||||
# - ~/.aws:/home/developer/.aws
|
# - ~/.aws:/home/developer/.aws
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
devbox-data:
|
devbox-data:
|
||||||
|
devbox-uv:
|
||||||
|
# devbox-rustup:
|
||||||
|
# devbox-cargo:
|
||||||
|
# devbox-vscode:
|
||||||
|
|||||||
Reference in New Issue
Block a user