From b81624185f42613dc77fa1d9521ac6c06c9c4ad5 Mon Sep 17 00:00:00 2001 From: Joana Hrotko Date: Tue, 7 May 2024 13:42:08 +0100 Subject: [PATCH] Add documentation for --menu up option and COMPOSE_MENU environemnt variable Co-authored-by: Milas Bowman Signed-off-by: Joana H Signed-off-by: Joana Hrotko --- cmd/compose/up.go | 3 +- docs/reference/compose.md | 3 ++ docs/reference/compose_up.md | 59 ++++++++++++++------------- docs/reference/docker_compose.yaml | 3 ++ docs/reference/docker_compose_up.yaml | 4 +- 5 files changed, 39 insertions(+), 33 deletions(-) diff --git a/cmd/compose/up.go b/cmd/compose/up.go index c6a2a66a7d..5e21f9f561 100644 --- a/cmd/compose/up.go +++ b/cmd/compose/up.go @@ -164,8 +164,7 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex 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 to wait for the project to be running|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 (Experimental). Incompatible with --detach.") - flags.MarkHidden("menu") //nolint:errcheck + 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.") return upCmd } diff --git a/docs/reference/compose.md b/docs/reference/compose.md index 09a4c69da9..7770f785a0 100644 --- a/docs/reference/compose.md +++ b/docs/reference/compose.md @@ -177,6 +177,9 @@ If flags are explicitly set on the command line, the associated environment vari Setting the `COMPOSE_IGNORE_ORPHANS` environment variable to `true` stops docker compose from detecting orphaned containers for the project. +Setting the `COMPOSE_MENU` environment variable to `false` disables the helper menu when running `docker compose up` +in attached mode. Alternatively, you can also run `docker compose up --menu=false` to disable the helper menu. + ### Use Dry Run mode to test your command Use `--dry-run` flag to test a command without changing your application stack state. diff --git a/docs/reference/compose_up.md b/docs/reference/compose_up.md index 3829963953..dbe00a82f0 100644 --- a/docs/reference/compose_up.md +++ b/docs/reference/compose_up.md @@ -5,35 +5,36 @@ Create and start containers ### Options -| Name | Type | Default | Description | -|:-------------------------------|:--------------|:---------|:--------------------------------------------------------------------------------------------------------| -| `--abort-on-container-exit` | | | Stops all containers if any container was stopped. Incompatible with -d | -| `--abort-on-container-failure` | | | Stops all containers if any container exited with failure. Incompatible with -d | -| `--always-recreate-deps` | | | Recreate dependent containers. Incompatible with --no-recreate. | -| `--attach` | `stringArray` | | Restrict attaching to the specified services. Incompatible with --attach-dependencies. | -| `--attach-dependencies` | | | Automatically attach to log output of dependent services | -| `--build` | | | Build images before starting containers | -| `-d`, `--detach` | | | Detached mode: Run containers in the background | -| `--dry-run` | | | Execute command in dry run mode | -| `--exit-code-from` | `string` | | Return the exit code of the selected service container. Implies --abort-on-container-exit | -| `--force-recreate` | | | Recreate containers even if their configuration and image haven't changed | -| `--no-attach` | `stringArray` | | Do not attach (stream logs) to the specified services | -| `--no-build` | | | Don't build an image, even if it's policy | -| `--no-color` | | | Produce monochrome output | -| `--no-deps` | | | Don't start linked services | -| `--no-log-prefix` | | | Don't print prefix in logs | -| `--no-recreate` | | | If containers already exist, don't recreate them. Incompatible with --force-recreate. | -| `--no-start` | | | Don't start the services after creating them | -| `--pull` | `string` | `policy` | Pull image before running ("always"\|"missing"\|"never") | -| `--quiet-pull` | | | Pull without printing progress information | -| `--remove-orphans` | | | Remove containers for services not defined in the Compose file | -| `-V`, `--renew-anon-volumes` | | | Recreate anonymous volumes instead of retrieving data from the previous containers | -| `--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` | | | Show timestamps | -| `--wait` | | | Wait for services to be running\|healthy. Implies detached mode. | -| `--wait-timeout` | `int` | `0` | Maximum duration to wait for the project to be running\|healthy | -| `-w`, `--watch` | | | Watch source code and rebuild/refresh containers when files are updated. | +| Name | Type | Default | Description | +|:-------------------------------|:--------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------| +| `--abort-on-container-exit` | | | Stops all containers if any container was stopped. Incompatible with -d | +| `--abort-on-container-failure` | | | Stops all containers if any container exited with failure. Incompatible with -d | +| `--always-recreate-deps` | | | Recreate dependent containers. Incompatible with --no-recreate. | +| `--attach` | `stringArray` | | Restrict attaching to the specified services. Incompatible with --attach-dependencies. | +| `--attach-dependencies` | | | Automatically attach to log output of dependent services | +| `--build` | | | Build images before starting containers | +| `-d`, `--detach` | | | Detached mode: Run containers in the background | +| `--dry-run` | | | Execute command in dry run mode | +| `--exit-code-from` | `string` | | Return the exit code of the selected service container. Implies --abort-on-container-exit | +| `--force-recreate` | | | Recreate containers even if their configuration and image haven't changed | +| `--menu` | | | Enable interactive shortcuts when running attached. Incompatible with --detach. Can also be enable/disable by setting COMPOSE_MENU environment var. | +| `--no-attach` | `stringArray` | | Do not attach (stream logs) to the specified services | +| `--no-build` | | | Don't build an image, even if it's policy | +| `--no-color` | | | Produce monochrome output | +| `--no-deps` | | | Don't start linked services | +| `--no-log-prefix` | | | Don't print prefix in logs | +| `--no-recreate` | | | If containers already exist, don't recreate them. Incompatible with --force-recreate. | +| `--no-start` | | | Don't start the services after creating them | +| `--pull` | `string` | `policy` | Pull image before running ("always"\|"missing"\|"never") | +| `--quiet-pull` | | | Pull without printing progress information | +| `--remove-orphans` | | | Remove containers for services not defined in the Compose file | +| `-V`, `--renew-anon-volumes` | | | Recreate anonymous volumes instead of retrieving data from the previous containers | +| `--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` | | | Show timestamps | +| `--wait` | | | Wait for services to be running\|healthy. Implies detached mode. | +| `--wait-timeout` | `int` | `0` | Maximum duration to wait for the project to be running\|healthy | +| `-w`, `--watch` | | | Watch source code and rebuild/refresh containers when files are updated. | diff --git a/docs/reference/docker_compose.yaml b/docs/reference/docker_compose.yaml index f725467df8..64e5b7a1d2 100644 --- a/docs/reference/docker_compose.yaml +++ b/docs/reference/docker_compose.yaml @@ -118,6 +118,9 @@ long: |- Setting the `COMPOSE_IGNORE_ORPHANS` environment variable to `true` stops docker compose from detecting orphaned containers for the project. + Setting the `COMPOSE_MENU` environment variable to `false` disables the helper menu when running `docker compose up` + in attached mode. Alternatively, you can also run `docker compose up --menu=false` to disable the helper menu. + ### Use Dry Run mode to test your command Use `--dry-run` flag to test a command without changing your application stack state. diff --git a/docs/reference/docker_compose_up.yaml b/docs/reference/docker_compose_up.yaml index 760a32da33..4c895f6a65 100644 --- a/docs/reference/docker_compose_up.yaml +++ b/docs/reference/docker_compose_up.yaml @@ -123,9 +123,9 @@ options: value_type: bool default_value: "false" description: | - Enable interactive shortcuts when running attached (Experimental). Incompatible with --detach. + Enable interactive shortcuts when running attached. Incompatible with --detach. Can also be enable/disable by setting COMPOSE_MENU environment var. deprecated: false - hidden: true + hidden: false experimental: false experimentalcli: false kubernetes: false