Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.41 KB

File metadata and controls

36 lines (26 loc) · 1.41 KB

Mini OpenCode DevKit

Containerized OpenCode local development environment using Ollama.

Quick start

./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

Host prerequisites

  • Ollama running at http://localhost:11434 (configurable via OLLAMA_HOST)
  • podman (not Docker)
  • jq (used in script for model tag parsing)

How it works

  1. Validates Ollama is reachable on the host
  2. Pulls model LocalLLAMA if missing
  3. Reads git identity from the source directory (or env GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL)
  4. Builds a podman image from Dockerfile (base: node:26.2.0-trixie-slim)
  5. 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).

Notable details

  • XDG dirs are pre-created in the image to prevent Bun EACCES errors.
  • Container uses --userns=keep-id and --security-opt=label=disable.
  • Git identity is forwarded into the container via env vars; global user.name/user.email are set on container start.
  • core.fsmonitor is disabled inside the container if the mounted dir is a git repo.
  • The .git directory in this repo is unrelated to the repo — there is no commit history or remote.