2026-09-28 23:17:45 +02:00
2026-09-30 23:14:15 +02:00
2026-09-30 23:14:15 +02:00
2026-09-29 23:38:33 +02:00
2026-09-28 23:17:45 +02:00

OpenCode Podman Dev Environment

Podman-based Ubuntu 26.04 development container for OpenCode.

Decisions

  • Ubuntu 26.04, amd64/x86_64
  • OpenCode pinned to 1.18.32
  • Node.js 24.21.0 LTS, official Linux x64 binary
  • OpenJDK 11 + 17, Java 17 default
  • Python 3 from Ubuntu + pip + venv
  • Maven, no Gradle
  • Neovim installed with no custom configuration
  • non-root dev user
  • rootless Podman with --userns=keep-id
  • no Podman/Docker socket
  • no proxy configuration
  • SSH only for Git; host .ssh is read-only and host SSH agent is forwarded when available
  • host timezone and locale
  • custom CA certificates are host-mounted read-only and installed at runtime; invalid certs warn and do not stop startup
  • OpenCode config/data/cache and development caches persist on the host
  • Bash history is ephemeral

Host data

The scripts create automatically:

~/dev/opencode-dev/
├── opencode-config/
├── opencode-data/
├── opencode-cache/
├── m2/
├── npm-cache/
├── pip-cache/
├── certs/
├── bash/
└── projects/

OpenCode stores provider credentials in ~/.local/share/opencode/auth.json, which is therefore persisted by the opencode-data mount.

Build

chmod +x build.sh dev.sh opencode.sh
./build.sh

Clean rebuild:

./build.sh --no-cache

Intentional update rebuild:

./build.sh --update

Shell

./dev.sh

Start in a project:

./dev.sh ~/dev/opencode-dev/projects/my-project

The same projects tree is mounted as /workspace.

Optional additional mount:

./dev.sh ~/dev/opencode-dev/projects/my-project \
  --mount "$HOME/another-project:/extra"

Put custom Bash settings in:

~/dev/opencode-dev/bash/bashrc

They are loaded after the image's normal Bash environment. History remains ephemeral.

OpenCode

./opencode.sh

Or start in a project:

./opencode.sh ~/dev/opencode-dev/projects/my-project

Arguments are forwarded to OpenCode:

./opencode.sh ~/dev/opencode-dev/projects/my-project --help

Persistent mounts

Host Container Mode
opencode-config ~/.config/opencode RW
opencode-data ~/.local/share/opencode RW
opencode-cache ~/.cache/opencode RW
m2 ~/.m2 RW
npm-cache ~/.npm RW
pip-cache ~/.cache/pip RW
certs /host-certs RO
~/.gitconfig ~/.gitconfig RO
~/.ssh ~/.ssh RO
bash /host-bash RO
projects /workspace RW

No credentials or personal OpenCode state are baked into the image.

S
Description
Opencode dev container
Readme 306 KiB
Languages
Shell 55.8%
Dockerfile 44.2%