A containerized development environment for AI-assisted coding and full-stack work, packaged as a reproducible Docker image with modern CLI tooling.
- Portable workspace with assistants (Claude Code, Codex, OpenCode, Cursor) and polyglot toolchains
- Multi-stage image build that extracts heavy tooling to the host for reuse between rebuilds
- Opinionated defaults that mirror the author’s macOS-based setup for low-friction onboarding
- macOS: Apple M-series Tahoe v26.0.1
- OrbStack: orbctl 2.0.2 (2000200)
- Terminal: Ghostty v1.2.0 (supports CMD+click URL auth)
- Xcode: Required to provide
infocmpduring image build
- Base distro: Debian (downstream of
oven/bun:latest) - Approximate size: 2 GB total (Rustup toolchain accounts for ~1.3 GB)
- ~10 bin builder build time
fd10.3.0 – fast file finderripgrep14.1.1 – recursive searchast-grep0.39.4 – structural code searchzellij0.43.1 – terminal multiplexercargo-cache– cargo cache management
- Python:
uv,code-graph-rag(commit 0037ad4) - Bun globals:
@anthropic-ai/claude-code,@openai/codex,opencode-ai - System utilities:
build-essential,cmake,git,curl,wget,fzf,jq,yq,bc,bat,btop,iproute2,iputils-ping,net-tools,socat,netcat,vim,tmux - Rust toolchain:
rustupwithwasm32-unknown-unknowntarget (registry cache cleaned post-build)
- Clone the repo:
git clone https://github.com/tegonzalez/c0dev.git - Enter the project:
cd c0dev - Load helper scripts into
PATH:./env.sh - Build the image:
c0 build(first build takes ~10 minutes)
- Start services:
c0 start - Open a shell as the dev user:
c0 sh(auto-navigates to matching project directory)
# Clone the repository
git clone https://github.com/tegonzalez/c0dev.git
cd c0dev
# Enter sub-shell for c0dev PATH
./env.sh
# Build the Docker image (~10 minutes)
c0 buildBuild Time: Approximately 10 minutes for full build including Rust toolchain installation.
- Ensures file mappings exist on host (prevents Docker from creating directories)
- Builds
tools-builderstage with uv, Cursor CLI, code-graph-rag, and Rust tools - Extracts built tools to host directories (
.local,.cargo,.rustup) - Builds final Docker image with system packages and global tools
- Installs terminfo for proper terminal emulation
# Start the development environment
c0 start
# Enter container as dev user (UID 1000)
c0 sh
# Enter container as root (UID 0)
# Note: Use 'c0 root' instead of sudo
c0 root
# Stop the environment
c0 stop
# Restart services
c0 restart
# View logs
c0 logs
# Check status
c0 status
# Rebuild (force with -f flag)
c0 build [-f]- Run
claude setup-tokeninside the container. - Follow the browser prompt (Ghostty users can CMD+click the URL) and approve long-term access.
- Wait for the CLI to confirm the token was stored under
/home/dev/.claude.json(persisted via the host volume).
- Start the local redirect listener:
c0 codex-auth(keeps port 1455 open while you log in). - In a separate terminal, run
codex loginand complete the web-based OAuth flow. - After the CLI reports success, return to the first terminal and press
Ctrl+Cto stopc0 codex-auth.
- Run
opencode auth loginto start the interactive login. - Choose your provider (or supply a URL) and finish the browser flow when prompted.
- The CLI saves credentials under
/home/dev/.config/opencode, so future sessions reuse the same login.
Persistent host ↔ container paths for credentials, tooling, and projects:
.claude/→/home/dev/.claude.config/→/home/dev/.config.cargo/→/home/dev/.cargo.local/→/home/dev/.local.rustup/→/home/dev/.rustup.terminfo/→/home/dev/.terminforules/→/home/dev/rulesprojects/→/home/dev/projectsbin/→/home/dev/bin.claude.json→/home/dev/.claude.json
These mappings keep credentials, tool installs, and in-progress work outside the ephemeral container filesystem.
- Locale:
en_US.UTF-8 - Timezone:
America/Los_Angeles(TZbuild arg overrides) - Exposed ports:
1455(Codex auth),3000(general dev server) - LLM provider: Ollama at
http://host.docker.internal:11434 - Default model:
gpt-oss:20b
- Verify host directories exist before mounting volumes
- Build
tools-builderstage (uv, Cursor CLI, code-graph-rag, Rust tools) - Extract tool artifacts to host (
.local,.cargo,.rustup) - Assemble final runtime image with system packages and global CLIs
- Install terminfo database for accurate terminal emulation
- Container has public network access with host bridging
host.docker.internalresolves to the host for local services (e.g., Ollama)
- Build failures: confirm Xcode is available for
infocmp, rerun withc0 build -fto force rebuild - Volume issues: ensure host directories exist and remain writable before running
c0 build