From 4258174a3a20a9dd382ac4df64b87a64fe859122 Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Sun, 16 Aug 2026 02:47:33 +0500 Subject: [PATCH] docs: spell out what compose --wait actually waits for running|healthy was easy to misread. --wait blocks until each service is running, or healthy when it has a healthcheck. Signed-off-by: Dean Chen <862469039@qq.com> --- cmd/compose/start.go | 4 ++-- cmd/compose/up.go | 4 ++-- docs/reference/compose_start.md | 4 ++-- docs/reference/compose_up.md | 4 ++-- docs/reference/docker_compose_start.yaml | 4 ++-- docs/reference/docker_compose_up.yaml | 4 ++-- pkg/api/api.go | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/compose/start.go b/cmd/compose/start.go index 062efb680d2..8ad972bd24a 100644 --- a/cmd/compose/start.go +++ b/cmd/compose/start.go @@ -45,8 +45,8 @@ func startCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Back ValidArgsFunction: completeServiceNames(dockerCli, p), } flags := startCmd.Flags() - flags.BoolVar(&opts.wait, "wait", false, "Wait for services to be running|healthy. Implies detached mode.") - flags.IntVar(&opts.waitTimeout, "wait-timeout", 0, "Maximum duration in seconds to wait for the project to be running|healthy") + flags.BoolVar(&opts.wait, "wait", false, "Wait until services are running, or healthy if they have a healthcheck. Implies detached mode.") + flags.IntVar(&opts.waitTimeout, "wait-timeout", 0, "Maximum duration in seconds to wait for services to be running or healthy") return startCmd } diff --git a/cmd/compose/up.go b/cmd/compose/up.go index abd4fd10d94..0623781e9e9 100644 --- a/cmd/compose/up.go +++ b/cmd/compose/up.go @@ -170,8 +170,8 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Backend flags.StringArrayVar(&up.attach, "attach", []string{}, "Restrict attaching to the specified services. Incompatible with --attach-dependencies.") flags.StringArrayVar(&up.noAttach, "no-attach", []string{}, "Do not attach (stream logs) to the specified services") flags.BoolVar(&up.attachDependencies, "attach-dependencies", false, "Automatically attach to log output of dependent services") - flags.BoolVar(&up.wait, "wait", false, "Wait for services to be running|healthy. Implies detached mode.") - flags.IntVar(&up.waitTimeout, "wait-timeout", 0, "Maximum duration in seconds to wait for the project to be running|healthy") + flags.BoolVar(&up.wait, "wait", false, "Wait until services are running, or healthy if they have a healthcheck. Implies detached mode.") + flags.IntVar(&up.waitTimeout, "wait-timeout", 0, "Maximum duration in seconds to wait for services to be running or healthy") flags.BoolVarP(&up.watch, "watch", "w", false, "Watch source code and rebuild/refresh containers when files are updated.") flags.BoolVar(&up.navigationMenu, "menu", false, "Enable interactive shortcuts when running attached. Incompatible with --detach. Can also be enable/disable by setting COMPOSE_MENU environment var.") flags.BoolVarP(&create.AssumeYes, "yes", "y", false, `Assume "yes" as answer to all prompts and run non-interactively`) diff --git a/docs/reference/compose_start.md b/docs/reference/compose_start.md index 06229e5940e..0f2affe4858 100644 --- a/docs/reference/compose_start.md +++ b/docs/reference/compose_start.md @@ -8,8 +8,8 @@ Starts existing containers for a service | Name | Type | Default | Description | |:-----------------|:-------|:--------|:---------------------------------------------------------------------------| | `--dry-run` | `bool` | | Execute command in dry run mode | -| `--wait` | `bool` | | Wait for services to be running\|healthy. Implies detached mode. | -| `--wait-timeout` | `int` | `0` | Maximum duration in seconds to wait for the project to be running\|healthy | +| `--wait` | `bool` | | Wait until services are running, or healthy if they have a healthcheck. Implies detached mode. | +| `--wait-timeout` | `int` | `0` | Maximum duration in seconds to wait for services to be running or healthy | diff --git a/docs/reference/compose_up.md b/docs/reference/compose_up.md index b7f17a0fac9..40fca58c353 100644 --- a/docs/reference/compose_up.md +++ b/docs/reference/compose_up.md @@ -51,8 +51,8 @@ If the process is interrupted using `SIGINT` (ctrl + C) or `SIGTERM`, the contai | `--scale` | `stringArray` | | Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present. | | `-t`, `--timeout` | `int` | `0` | Use this timeout in seconds for container shutdown when attached or when containers are already running | | `--timestamps` | `bool` | | Show timestamps | -| `--wait` | `bool` | | Wait for services to be running\|healthy. Implies detached mode. | -| `--wait-timeout` | `int` | `0` | Maximum duration in seconds to wait for the project to be running\|healthy | +| `--wait` | `bool` | | Wait until services are running, or healthy if they have a healthcheck. Implies detached mode. | +| `--wait-timeout` | `int` | `0` | Maximum duration in seconds to wait for services to be running or healthy | | `-w`, `--watch` | `bool` | | Watch source code and rebuild/refresh containers when files are updated. | | `-y`, `--yes` | `bool` | | Assume "yes" as answer to all prompts and run non-interactively | diff --git a/docs/reference/docker_compose_start.yaml b/docs/reference/docker_compose_start.yaml index 56f9bcdff7c..dbc4df523da 100644 --- a/docs/reference/docker_compose_start.yaml +++ b/docs/reference/docker_compose_start.yaml @@ -8,7 +8,7 @@ options: - option: wait value_type: bool default_value: "false" - description: Wait for services to be running|healthy. Implies detached mode. + description: Wait until services are running, or healthy if they have a healthcheck. Implies detached mode. deprecated: false hidden: false experimental: false @@ -19,7 +19,7 @@ options: value_type: int default_value: "0" description: | - Maximum duration in seconds to wait for the project to be running|healthy + Maximum duration in seconds to wait for services to be running or healthy deprecated: false hidden: false experimental: false diff --git a/docs/reference/docker_compose_up.yaml b/docs/reference/docker_compose_up.yaml index 8c78a8fa683..1867a1612c1 100644 --- a/docs/reference/docker_compose_up.yaml +++ b/docs/reference/docker_compose_up.yaml @@ -289,7 +289,7 @@ options: - option: wait value_type: bool default_value: "false" - description: Wait for services to be running|healthy. Implies detached mode. + description: Wait until services are running, or healthy if they have a healthcheck. Implies detached mode. deprecated: false hidden: false experimental: false @@ -300,7 +300,7 @@ options: value_type: int default_value: "0" description: | - Maximum duration in seconds to wait for the project to be running|healthy + Maximum duration in seconds to wait for services to be running or healthy deprecated: false hidden: false experimental: false diff --git a/pkg/api/api.go b/pkg/api/api.go index 9a1430df3c2..31fe7ec3f5c 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -294,7 +294,7 @@ type StartOptions struct { OnExit Cascade // ExitCodeFrom return exit code from specified service ExitCodeFrom string - // Wait won't return until containers reached the running|healthy state + // Wait won't return until containers are running, or healthy if they have a healthcheck Wait bool WaitTimeout time.Duration // Services passed in the command line to be started