---
schema_version: 1
route: /t/docker-compose.md
tool: "docker-compose"
---

# sincecutoff.com /t/docker-compose — Docker Compose

- name: Docker Compose
- kind: cli
- children: none
- homepage: <https://github.com/docker/compose>

Changes to the tools coding agents drive, since a model's training cutoff, each linked to its first-party source. Check installed versions and limitations before acting; a cutoff date does not establish what a model knows.
Original editorial content: [Apache 2.0](https://sincecutoff.com/v1/data-license.txt), by [0xPatrick](https://0xpatrick.dev). Preserve applicable license and [NOTICE](https://sincecutoff.com/notice.txt) attribution when redistributing. Third-party source text and examples retain their own rights. [License scope and attribution](https://sincecutoff.com/v1/license.json).
To stay current, read the changes feed: [`/v1/changes.md?tool=docker-compose`](https://sincecutoff.com/v1/changes.md?tool=docker-compose) (or `.json`), adding `since=YYYY-MM-DD` for your training cutoff. Entries for registered children are included; the registry itself is `/v1/tools.json`. How to page and save your place: [llms.txt](https://sincecutoff.com/llms.txt).

### docker compose run executes manually triggered jobs (2026-10-02)
- slug: docker-compose-run-executes-manually-triggered-jobs-77a6c906e463
- score: 0.98

How to use it:

When you need to trigger a manually triggered job declared in the Compose project, run `docker compose run <job>`; v5.6.0 supports manual jobs, while scheduled jobs are not yet available.

Examples:

```
docker compose run <job>
```

```
docker compose run [OPTIONS] SERVICE [COMMAND] [ARGS...]
```

- why_it_matters: Run a manually triggered job declared in a Compose project.
- sources: <https://github.com/docker/compose/releases/tag/v5.6.0>, <https://github.com/docker/compose/pull/14093>, <https://docs.docker.com/reference/cli/docker/compose/run/>
- gotchas: "Version: v5.6.0"; "Availability: Partial support for jobs: only manually-triggered jobs are supported; scheduled jobs are not yet available. Full job support will land once the corresponding Docker Engine support is merged."; "SERVICE / <job> (required): Compose service or job to run."; "[COMMAND] [ARGS...]: Optional command and arguments; the command overrides the configured service command."; "Prerequisite: Use Docker Compose v5.6.0 or later for the documented manual-job support; scheduled jobs are not available in this release."; "`up` warns about declared jobs and points to `docker compose run` to trigger them."; "`up` fails on active (profile-enabled) scheduled jobs with `scheduled jobs are not supported in this version`."; "Only manually triggered jobs are supported; scheduled jobs are not yet available."

### docker-compose SDK ScaleOptions carries replica counts (2026-09-03)
- slug: docker-compose-sdk-scaleoptions-carries-replica-counts-ed4bf85d61b3
- score: 0.97

How to use it:

When scaling services through the Compose SDK, set `ScaleOptions.Replicas` to the desired service counts and call `Scale(ctx, project, options)`; `Services` selects services for recreation-policy handling and defaults to the replica-map keys when empty.

Examples:

```
options := api.ScaleOptions{Replicas: map[string]int{"<service>": <replica-count>}}
err := backend.Scale(ctx, project, options)
```

- why_it_matters: Use the Compose SDK to scale services in a project.
- before: The CLI mutated the project model with SetScale before calling the backend; SDK callers following the Scale interface documentation could get a no-op convergence because ScaleOptions had no replica count.
- sources: <https://github.com/docker/compose/releases/tag/v5.5.1>, <https://github.com/docker/compose/pull/14077>, <https://github.com/docker/compose/blob/v5.5.1/pkg/api/api.go>
- gotchas: "Version: v5.5.1"; "ScaleOptions.Replicas: Map service names to desired replica counts; Scale applies these counts to the project model before convergence."; "ScaleOptions.Services: Services whose containers may be recreated on configuration divergence while converging; empty defaults to the keys of Replicas. No mutual exclusion with Replicas is documented."; "Scale(ctx, project, options) (required): Scale sets replica counts and converges the project, creating, removing, and starting containers as needed."; "A pre-mutated project with an empty `Replicas` map continues to work as before."

### Docker Compose supports pre_start service lifecycle hooks (2026-07-02)
- slug: docker-compose-supports-pre-start-service-lifecycle-hooks-3751bc8de970
- score: 0.91

How to use it:

When a service needs initialization before it starts, configure its `pre_start` hook. Run `docker compose up` to start the application; each hook step runs in an ephemeral container and a non-zero exit prevents the service from starting.

Examples:

```
services:
  app:
    image: <service-image>
    pre_start:
      - command: <initialization-command>

docker compose up
```

- why_it_matters: Run a service initialization hook before starting its containers in a Compose application.
- sources: <https://github.com/docker/compose/releases/tag/v5.3.0>, <https://github.com/docker/compose/pull/13862>, <https://docs.docker.com/reference/compose-file/services/>
- gotchas: "Version: v5.3.0"; "services.<service>.pre_start: Sequence of init-container steps that run before the service container starts."; "pre_start[].command: Command to run; optional if the image entrypoint already runs the intended command."; "pre_start[].image: Image for the ephemeral container; defaults to the parent service image."; "pre_start[].user: Command user; defaults to the image user, or the service command user if `image` is omitted."; "pre_start[].privileged: Whether the hook command runs with privileged access."; "pre_start[].working_dir: Hook working directory; defaults to the service command working directory."; "pre_start[].environment: Environment values for the hook; inherits the service command environment and can append or override values."; "pre_start[].per_replica: Set `false` to run once for the service before any replica starts."; "Prerequisite: Requires Docker Compose 5.3.0 or later."; "The hook runs once per service, only when no replica is already running."
