Documentation
¶
Overview ¶
compose drives a 2-service devcontainer described by a Docker Compose project: a primary `app` service and a sidecar `db`. The engine starts both services, lets us exec on the primary, and tears the project down at the end.
Requires: Docker daemon + Docker Compose v2 plugin (`docker compose version` must work).
Run:
go run ./examples/compose
What happens:
- Creates a temp workspace with docker-compose.yml (app + db) and a devcontainer.json pointing at it.
- Up: the engine loads the compose project via compose-go, generates dc-build.yaml + dc-run.yaml override files, invokes `docker compose up -d`, and resolves the primary service's container.
- Exec on the primary prints what it sees and confirms the sidecar is reachable on the project network by service name.
- Down(Remove: true) tears the whole project down.
Click to show internal directories.
Click to hide internal directories.