Conversation
okrammer
commented
May 19, 2026
- Parse volume-mounts section in opencode-sandbox-config.yaml and write to volume-mounts.txt during ocs-rebuild-container
- Parse docker-in-docker scalar flag; when true, inject the Docker socket as an entry in volume-mounts.txt automatically
- Extend YAML parser in ocs-rebuild-container to handle top-level scalars (key: value) alongside section headers (key:), clearing section context on scalar entries; add cfg_ / post-parse pattern for future scalars
- ocs-start-container reads volume-mounts.txt and builds -v flags for each entry; expands env vars in host paths (e.g. $HOME); prints mount summary
- entrypoint.sh: dynamically match docker group GID of mounted socket so dev user can access it regardless of host runtime (Colima, Podman, etc.)
- Add volume-mounts and docker-in-docker entries to init-templates config
- Add docker-cli to mise.toml for this repo's own sandbox
- docs: add Docker-in-Docker setup section to README with mise.toml example
- docs: update AGENTS.md to reflect docker CLI availability and clarify podman/ocs-* constraints
There was a problem hiding this comment.
Pull request overview
Adds support for two new opencode-sandbox-config.yaml features: arbitrary volume-mounts (extra host-to-container bind mounts) and a docker-in-docker flag that mounts the host Docker socket and dynamically aligns the dev user's group membership at container entry. Extends the bash YAML parser in ocs-rebuild-container with a top-level scalar form (key: value), wires the new mounts into ocs-start-container's docker run invocation, and updates the templates, this project's own sandbox config/mise toolchain, and the docs.
Changes:
- Parser change in
ocs-rebuild-containerto recognize top-level scalars alongside section headers, plus emission ofvolume-mounts.txtand conditional injection of the docker socket mount. ocs-start-containernow readsvolume-mounts.txt, expands env vars in host paths viaeval echo, builds-vflags, and logs them;entrypoint.shaligns adockergroup to the mounted socket's GID and adds thedevuser to it.- Template, sample config,
mise.toml, README, and AGENTS.md updates documenting the new feature.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bin/ocs-rebuild-container | Adds scalar-vs-section parsing branch, volume-mounts.txt output, and post-parse docker-socket injection. |
| bin/ocs-start-container | Reads volume-mounts.txt, expands env vars with eval, builds -v flags, logs them, and passes them to docker run. |
| entrypoint.sh | Creates a docker group matching the mounted socket's GID and adds dev to it. |
| opencode-sandbox-config.yaml | Enables docker-in-docker: true for this repo's own sandbox; adds placeholder volume-mounts and an unrelated commented host-ports entry. |
| init-templates/opencode-sandbox-config.yaml | Adds documented volume-mounts and docker-in-docker template entries. |
| mise.toml | Adds docker-cli for this repo's sandbox. |
| README.md | Documents volume-mounts, docker-in-docker, and the Docker-in-Docker setup walkthrough. |
| AGENTS.md | Updates agent-facing notes to reflect docker CLI availability and the scalar-vs-section parser rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Parse volume-mounts section in opencode-sandbox-config.yaml and write to volume-mounts.txt during ocs-rebuild-container - Parse docker-in-docker scalar flag; when true, inject the Docker socket as an entry in volume-mounts.txt automatically - Extend YAML parser in ocs-rebuild-container to handle top-level scalars (key: value) alongside section headers (key:), clearing section context on scalar entries; add cfg_<name> / post-parse pattern for future scalars - ocs-start-container reads volume-mounts.txt and builds -v flags for each entry; expands env vars in host paths (e.g. $HOME); prints mount summary - entrypoint.sh: dynamically match docker group GID of mounted socket so dev user can access it regardless of host runtime (Colima, Podman, etc.) - Add volume-mounts and docker-in-docker entries to init-templates config - Add docker-cli to mise.toml for this repo's own sandbox - docs: add Docker-in-Docker setup section to README with mise.toml example - docs: update AGENTS.md to reflect docker CLI availability and clarify podman/ocs-* constraints
close2infinity
left a comment
There was a problem hiding this comment.
Reviewed without findings & tested both new features successfully.