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 Doc...

Source: DEV Community
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 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