Skip to content

feat: add volume-mounts and docker-in-docker support#1

Open
okrammer wants to merge 1 commit into
mainfrom
mounting
Open

feat: add volume-mounts and docker-in-docker support#1
okrammer wants to merge 1 commit into
mainfrom
mounting

Conversation

@okrammer
Copy link
Copy Markdown
Member

  • 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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-container to recognize top-level scalars alongside section headers, plus emission of volume-mounts.txt and conditional injection of the docker socket mount.
  • ocs-start-container now reads volume-mounts.txt, expands env vars in host paths via eval echo, builds -v flags, and logs them; entrypoint.sh aligns a docker group to the mounted socket's GID and adds the dev user 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.

Comment thread mise.toml Outdated
Comment thread opencode-sandbox-config.yaml Outdated
- 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
Copy link
Copy Markdown
Collaborator

@close2infinity close2infinity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed without findings & tested both new features successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants