T-4: DockerOrchestrator — container lifecycle via bollard#63
Merged
kirich1409 merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
Production Docker orchestration: create/start/stop/remove containers, exec with TTY attach, image pull with skip-if-local, per-session network isolation, resource limits (CPU, memory, PIDs), seccomp support, and image whitelist enforcement. Extends DockerConfig with default_image, memory_limit, memory_swap, cpu_limit, and seccomp_profile fields. Closes #21 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a production-ready Docker orchestration layer to the runner, enabling end-to-end container lifecycle management via bollard with configurable defaults and resource/security controls.
Changes:
- Introduces
DockerOrchestrator(runner/src/docker.rs) supporting image ensure/pull, per-session network creation, container create/start/stop/remove, and exec attach + PTY resize. - Extends
DockerConfigwith default image + resource/security settings (memory, swap, CPU, seccomp profile) and updates config parsing defaults/tests. - Wires the new docker module into the runner crate (
mod docker;).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| runner/src/main.rs | Registers the new docker module in the runner crate. |
| runner/src/docker.rs | Implements the new Docker orchestration API, helpers, and unit tests. |
| runner/src/config.rs | Adds new Docker configuration fields with defaults and expands config tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DockerOrchestratorinrunner/src/docker.rs— full container lifecycle management via bollard: create/start/stop/remove, exec with TTY attach, image pull (skip if local), per-session Docker network isolation, resource limits (CPU, memory, PIDs), seccomp profile support, image whitelist enforcementDockerConfigwithdefault_image,memory_limit,memory_swap,cpu_limit,seccomp_profilefields (backward-compatible defaults)relay.managed=trueandrelay.session_id=<id>Acceptance Criteria
create_container->exec_attach-> bidirectional I/Oresize_execchanges PTY dimensionsstop_containerwith configurable timeout (SIGTERM -> SIGKILL)ensure_imageskips pull if image exists locallyrelay.managed=true,relay.session_id=<id>Test plan
cargo build— compilescargo fmt --check— formattedcargo clippy --all-targets --all-features -- -D warnings— no warningscargo test— 118 tests pass (including new docker module tests)Closes #21