Containerized OpenCode local development environment using Ollama.
./start.sh # mount cwd
./start.sh ~/my-project # mount specific project
./start.sh -e FOO=bar ~/x # extra env vars
./start.sh -n my-name ~/x # override container name- Ollama running at
http://localhost:11434(configurable viaOLLAMA_HOST) - podman (not Docker)
- jq (used in script for model tag parsing)
- Validates Ollama is reachable on the host
- Pulls model
LocalLLAMAif missing - Reads git identity from the source directory (or env
GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL) - Builds a podman image from
Dockerfile(base:node:26.2.0-trixie-slim) - Launches an interactive container mounting source at
/workspaces/<project>
Inside the container, run opencode — the binary is at /home/dev/.opencode/bin/opencode (prepended to PATH).
- XDG dirs are pre-created in the image to prevent Bun
EACCESerrors. - Container uses
--userns=keep-idand--security-opt=label=disable. - Git identity is forwarded into the container via env vars; global
user.name/user.emailare set on container start. core.fsmonitoris disabled inside the container if the mounted dir is a git repo.- The
.gitdirectory in this repo is unrelated to the repo — there is no commit history or remote.