Run OpenCode in Docker - Clean machine, same convenience
I didn't want another tool installed globally on my machine, so I containerized OpenCode . The result: opencode-dockerized - a Docker Compose setup that runs OpenCode web in a container with the Docker CLI and mounted socket, so it can still manage containers on your host. Why bother Dockerizing it? No global installs or version conflicts on your local machine Same environment everywhere, easy to share with a team OpenCode config and auth live inside the project, not scattered across ~/.local/share How it works The setup is straightforward: # Build once make opencode-build # Run make opencode-run # → http://localhost:4096 # Tear down make opencode-down The trickier parts are handled automatically: Docker socket access - The container mounts /var/run/docker.sock so opencode can run Docker c
I didn't want another tool installed globally on my machine, so I containerized OpenCode.
The result: opencode-dockerized - a Docker Compose setup that runs OpenCode web in a container with the Docker CLI and mounted socket, so it can still manage containers on your host.
Why bother Dockerizing it?
-
No global installs or version conflicts on your local machine
-
Same environment everywhere, easy to share with a team
-
OpenCode config and auth live inside the project, not scattered across ~/.local/share
How it works
The setup is straightforward:
# Build once make opencode-build# Build once make opencode-buildRun
make opencode-run
→ http://localhost:4096
Tear down
make opencode-down`
Enter fullscreen mode
Exit fullscreen mode
The trickier parts are handled automatically:
Docker socket access - The container mounts /var/run/docker.sock so opencode can run Docker commands on the host. The entrypoint detects the socket's GID at runtime and adds the opencode user to that group before dropping privileges. No manual config needed, works on both macOS (Docker Desktop) and Linux.
UID/GID matching - The container runs as a non-root user with your host's UID/GID, detected automatically by the Makefile. Files created inside the container have the right ownership on the host.
Auth persistence - Credentials are written to .opencode/share/auth.json (gitignored). If you're already authenticated locally, you can just copy your existing auth.json in and skip the login flow entirely.
What it does not
This setup does not provide meaningful isolation from the host. Mounting the Docker socket gives the container full access to the host Docker daemon.
Some features for my own convenience (and maybe yours?)
The RPI workflow
The repo ships slash commands that implement a Research → Plan → Implement workflow:
-
/research - explores the codebase, writes a research doc to docs/thoughts/
-
/deep-research - same, but uses Claude Opus for harder problems
-
/plan - turns the research doc into a numbered implementation plan
-
/implement - executes the plan step by step and runs a quality gate
Each phase is intentionally scoped: research never touches code, plan never touches code, implement follows the plan exactly.
Create Skills - persistent domain knowledge - via command
Skills are folders under .opencode/skills// that the model loads on demand. Each one contains:
-
SKILL.md - reference facts: file paths, data shapes, API shapes, naming rules
-
GOTCHAS.md - accumulated failure points and fixes, never deleted
-
HISTORY.md - append-only change log, one entry per session
-
assets/ and scripts/ - templates and helper scripts the agent can run
Scaffold a new skill with:
/skill billing-lib "Internal billing library - edge cases, footguns, charge flow"
Enter fullscreen mode
Exit fullscreen mode
Domain knowledge accumulates over time in version-controlled files rather than disappearing at the end of a chat session.
Try it!
git clone https://github.com/mazumba/opencode-dockerized cp compose.override.yml.dist compose.override.ymlgit clone https://github.com/mazumba/opencode-dockerized cp compose.override.yml.dist compose.override.ymlSet your projects path in compose.override.yml
make opencode-build && make opencode-run`
Enter fullscreen mode
Exit fullscreen mode
Would love feedback, especially if you run it on a setup I haven't tested. PRs and issues welcome!
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products

Unlocking Potential: The Best Low Cap BSC Tokens to Buy Now for High Returns
Unlocking Potential: The Best Low Cap BSC Tokens to Buy Now for High Returns Cryptocurrencies continue to capture the financial world’s attention, and the Binance Smart Chain (BSC) is a hotbed for low-cap tokens with transformative potential. In today’s dynamic market, finding the right tokens to invest in can yield enormous returns. One token that stands out among the crowd is the Decentrawood (DEOD) , which is rapidly gaining traction in the social metaverse space. Understanding Low Cap Tokens and Their Benefits Low cap tokens, generally defined as cryptocurrencies with a market capitalization of less than $100 million, offer unique advantages, such as: Higher growth potential: Being at the beginning of their maturity curve, these tokens can deliver exponential returns. Niche markets: Ma

Unlocking the Future of Development with Lenify: An Introductory Guide
Introduction In the fast-paced world of software development, innovation is the name of the game. Enter Lenify, the world’s first 100% Software Blueprint-driven AI development platform that's transforming how we build applications. This article will introduce you to the revolutionary capabilities of Lenify and how it can enhance your development processes. Understanding Lenify’s AI-driven Blueprint Platform Lenify’s platform is engineered to generate comprehensive software development blueprints. These aren’t just basic outlines; they’re sophisticated architectural visions that guide your projects from concept to completion. Imagine having an AI architect that not only understands your project’s needs but also assists in streamlining the entire development lifecycle. The Power of AI Bluepr

Creating Stunning Easter-Themed AI Images with NanoBanana2
Creating Stunning Easter-Themed AI Images in 2026 Easter is here, and what better way to celebrate than with AI-generated Easter-themed images? In this guide, we'll walk you through creating beautiful, festive visuals using NanoBanana2 — the AI image generator designed for creators. Why AI-Generated Easter Content? Easter 2026 falls on April 5. Brands and content creators are scrambling to produce eye-catching visuals. AI image generation cuts your design time from hours to minutes while maintaining professional quality. The Easter 2026 Aesthetic Think: 🐣 Colorful Easter eggs with intricate patterns 🐰 Cute Easter bunnies in spring gardens 🌷 Easter lilies and spring flowers 🎨 Pastel color palettes and festive scenes Step-by-Step Guide Step 1: Define Your Vision What's your Easter image




Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!