Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

containerized-coding

Run OpenCode inside a rootless Podman container, isolating it from the host filesystem while keeping the workflow low-friction.

What it does

  • Builds a Debian Stable image with OpenCode, zsh, and common project tools.
  • Provides an oc shell alias that enters a container for the current Git project.
  • Mounts only the project, OpenCode config, and OpenCode state database.
  • Uses one persistent container per project.

Setup

cd ~/Git/Mine/containerized-coding
podman build -t opencode -f Containerfile .
echo 'source ~/Git/Mine/containerized-coding/alias.sh' >> ~/.zshrc
source ~/.zshrc

Usage

cd ~/Git/Mine/homelab
oc

Requirements

  • Rootless Podman
  • zsh
  • A Git project

Docker (rootless)

Alternative to the Podman setup. Sources your live OpenCode config directly via read-only bind-mounts instead of baking a copy into the image.

Setup

docker build -t opencode -f Dockerfile .
echo 'source ~/Git/TOOLS/containerized-coding/alias-docker.sh' >> ~/.zshrc
source ~/.zshrc

Source either alias.sh (Podman) or alias-docker.sh (Docker) — both define oc.

Usage

cd ~/Git/Mine/homelab
oc

How it differs from Podman

  • Requires rootless Docker (docker-ce-rootless-extras). Container root maps to your host UID: /workspace files stay yours, and a container escape lands as your unprivileged user — not root.
  • Config is mounted live, read-only from ~/.config/opencode (plus the agents symlink target) instead of copied in. Edit config on the host, it's instantly live — no rebuild.
  • Sessions and auth persist via ~/.local/share/opencode (RW), same as Podman.

Requirements (Docker)

  • Rootless Docker
  • zsh
  • A Git project

See also

  • docs/DESIGN.md — full design and trade-offs.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages