Skip to content

feat(compose): add persistent Docker Compose support - #2123

Open
RobertDeRose wants to merge 4 commits into
apple:mainfrom
RobertDeRose:feature/container-compose
Open

feat(compose): add persistent Docker Compose support#2123
RobertDeRose wants to merge 4 commits into
apple:mainfrom
RobertDeRose:feature/container-compose

Conversation

@RobertDeRose

Copy link
Copy Markdown

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update

Motivation and Context

Inspired by the k8s' plugin implementation and container machines, this feels like the correct way to finally support docker-compose.yml workflows in an efficient way that doesn't require a full compose-to-container translation layer.

This adds container compose support backed by a persistent Linux container machine
running Docker Engine and the real Docker Compose CLI.

This provides a Docker-compatible Compose workflow without Docker Desktop while
keeping Compose state isolated inside a managed compose machine.

What Changed

  • Added the container compose plugin.
  • Automatically builds and provisions the bundled Compose machine image.
  • Persists the compose machine and its Docker data across invocations.
  • Forwards Compose arguments unchanged to /usr/bin/docker compose.
  • Added container machine start for generic stopped-machine recovery.
  • Added optional Docker socket access through --socket-path.
  • Added machine DNS aliases and published-port diagnostics.
  • Added configurable CPU, memory, and idle-shutdown settings.
  • Added ownership tokens and safe orphan/cancellation handling.
  • Added daemon-root-aware configuration loading.
  • Documented lifecycle, filesystem, networking, socket, and configuration behavior.

Important Behavior

  • container compose down removes Compose resources but does not delete or stop the machine.
  • All Compose projects share the persistent compose machine.
  • Bind mounts must be below the mounted macOS home directory.
  • Published ports are reachable through the Compose machine address, not automatically through macOS loopback.
  • --socket-path reports the endpoint only; it never starts the machine.
  • Configuration changes require restarting the container service.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Validation completed:

  • 814 unit tests across 91 suites passed.
  • Machine lifecycle integration tests passed, including first boot and starting a stopped machine.
  • Warnings-as-errors build passed.
  • git diff --check passed.

Related Issues and Discussions

- share boot initialization with specialized machine consumers
- persist ownership metadata and runtime profile settings
- add safe socket publication and orphan cleanup
- preserve default-machine behavior for managed callers
- cancel signal handlers when process I/O completes
- forward terminal and cancellation signals consistently
- terminate child processes when the operation is cancelled
- run the real Docker Compose CLI in a nested-Docker machine
- add image, socket, environment, completion, and help integration
- package the plugin and pinned machine image resources
- add opt-in idle shutdown and machine/DNS documentation
- cover Compose configuration, lifecycle, and DNS behavior
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.

1 participant