9e060a39fe8952f0c272f1dd06b27a85b9ba77cc
- Add uid and gid to dev user - Entry point script is mounted and not built in docker container - Change image name
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
devuser - rootless Podman with
--userns=keep-id - no Podman/Docker socket
- no proxy configuration
- SSH only for Git; host
.sshis 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.
Description
Languages
Shell
55.8%
Dockerfile
44.2%