Help us shape the future of Go! Take the 2026 Go Developer Survey

compose

command
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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:

  1. Creates a temp workspace with docker-compose.yml (app + db) and a devcontainer.json pointing at it.
  2. 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.
  3. Exec on the primary prints what it sees and confirms the sidecar is reachable on the project network by service name.
  4. Down(Remove: true) tears the whole project down.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL