瀏覽代碼

[v2] use "docker/cli-docs-tool" to generate docs

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sebastiaan van Stijn 4 年之前
父節點
當前提交
3678deed14

文件差異過大導致無法顯示
+ 0 - 0
docs/reference/docker_compose.yaml


+ 103 - 94
docs/reference/docker_compose_build.yaml

@@ -1,103 +1,112 @@
 command: docker compose build
 short: Build or rebuild services
-long: "Services are built once and then tagged, by default as `project_service`. \n\nIf the Compose file specifies an\n[image](https://github.com/compose-spec/compose-spec/blob/master/spec.md#image) name, \nthe image is tagged with that name, substituting any variables beforehand. See\n[variable interpolation](https://github.com/compose-spec/compose-spec/blob/master/spec.md#interpolation).\n\nIf you change a service's `Dockerfile` or the contents of its build directory, \nrun `docker compose build` to rebuild it."
+long: |-
+  Services are built once and then tagged, by default as `project_service`.
+
+  If the Compose file specifies an
+  [image](https://github.com/compose-spec/compose-spec/blob/master/spec.md#image) name,
+  the image is tagged with that name, substituting any variables beforehand. See
+  [variable interpolation](https://github.com/compose-spec/compose-spec/blob/master/spec.md#interpolation).
+
+  If you change a service's `Dockerfile` or the contents of its build directory,
+  run `docker compose build` to rebuild it.
 usage: docker compose build [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: build-arg
-      value_type: stringArray
-      default_value: '[]'
-      description: Set build-time variables for services.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: compress
-      value_type: bool
-      default_value: "true"
-      description: Compress the build context using gzip. DEPRECATED
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: force-rm
-      value_type: bool
-      default_value: "true"
-      description: Always remove intermediate containers. DEPRECATED
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: memory
-      shorthand: m
-      value_type: string
-      description: |
-        Set memory limit for the build container. Not supported on buildkit yet.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-cache
-      value_type: bool
-      default_value: "false"
-      description: Do not use cache when building the image
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-rm
-      value_type: bool
-      default_value: "false"
-      description: |
-        Do not remove intermediate containers after a successful build. DEPRECATED
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: parallel
-      value_type: bool
-      default_value: "true"
-      description: Build images in parallel. DEPRECATED
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: progress
-      value_type: string
-      default_value: auto
-      description: Set type of progress output ("auto", "plain", "noTty")
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: pull
-      value_type: bool
-      default_value: "false"
-      description: Always attempt to pull a newer version of the image.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: quiet
-      shorthand: q
-      value_type: bool
-      default_value: "false"
-      description: Don't print anything to STDOUT
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: build-arg
+  value_type: stringArray
+  default_value: '[]'
+  description: Set build-time variables for services.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: compress
+  value_type: bool
+  default_value: "true"
+  description: Compress the build context using gzip. DEPRECATED
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: force-rm
+  value_type: bool
+  default_value: "true"
+  description: Always remove intermediate containers. DEPRECATED
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: memory
+  shorthand: m
+  value_type: string
+  description: |
+    Set memory limit for the build container. Not supported on buildkit yet.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-cache
+  value_type: bool
+  default_value: "false"
+  description: Do not use cache when building the image
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-rm
+  value_type: bool
+  default_value: "false"
+  description: |
+    Do not remove intermediate containers after a successful build. DEPRECATED
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: parallel
+  value_type: bool
+  default_value: "true"
+  description: Build images in parallel. DEPRECATED
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: progress
+  value_type: string
+  default_value: auto
+  description: Set type of progress output ("auto", "plain", "noTty")
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: pull
+  value_type: bool
+  default_value: "false"
+  description: Always attempt to pull a newer version of the image.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: quiet
+  shorthand: q
+  value_type: bool
+  default_value: "false"
+  description: Don't print anything to STDOUT
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 78 - 73
docs/reference/docker_compose_convert.yaml

@@ -1,83 +1,88 @@
 command: docker compose convert
 aliases: config
 short: Converts the compose file to platform's canonical format
-long: "`docker compose convert` render the actual data model to be applied on target platform. When used with Docker engine,\nit merges the Compose files set by `-f` flags, resolves variables in Compose file, and expands short-notation into \nfully defined Compose model. \n\nTo allow smooth migration from docker-compose, this subcommand declares alias `docker compose config`"
+long: |-
+  `docker compose convert` render the actual data model to be applied on target platform. When used with Docker engine,
+  it merges the Compose files set by `-f` flags, resolves variables in Compose file, and expands short-notation into
+  fully defined Compose model.
+
+  To allow smooth migration from docker-compose, this subcommand declares alias `docker compose config`
 usage: docker compose convert SERVICES
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: format
-      value_type: string
-      default_value: yaml
-      description: 'Format the output. Values: [yaml | json]'
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: hash
-      value_type: string
-      description: Print the service config hash, one per line.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-interpolate
-      value_type: bool
-      default_value: "false"
-      description: Don't interpolate environment variables.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: profiles
-      value_type: bool
-      default_value: "false"
-      description: Print the profile names, one per line.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: quiet
-      shorthand: q
-      value_type: bool
-      default_value: "false"
-      description: Only validate the configuration, don't print anything.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: resolve-image-digests
-      value_type: bool
-      default_value: "false"
-      description: Pin image tags to digests.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: services
-      value_type: bool
-      default_value: "false"
-      description: Print the service names, one per line.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: volumes
-      value_type: bool
-      default_value: "false"
-      description: Print the volume names, one per line.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: format
+  value_type: string
+  default_value: yaml
+  description: 'Format the output. Values: [yaml | json]'
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: hash
+  value_type: string
+  description: Print the service config hash, one per line.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-interpolate
+  value_type: bool
+  default_value: "false"
+  description: Don't interpolate environment variables.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: profiles
+  value_type: bool
+  default_value: "false"
+  description: Print the profile names, one per line.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: quiet
+  shorthand: q
+  value_type: bool
+  default_value: "false"
+  description: Only validate the configuration, don't print anything.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: resolve-image-digests
+  value_type: bool
+  default_value: "false"
+  description: Pin image tags to digests.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: services
+  value_type: bool
+  default_value: "false"
+  description: Print the service names, one per line.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: volumes
+  value_type: bool
+  default_value: "false"
+  description: Print the volume names, one per line.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 41 - 42
docs/reference/docker_compose_cp.yaml

@@ -1,51 +1,50 @@
 command: docker compose cp
 short: Copy files/folders between a service container and the local filesystem
 long: Copy files/folders between a service container and the local filesystem
-usage: |-
-    docker compose cp [OPTIONS] SERVICE:SRC_PATH DEST_PATH|-
-    	docker compose cp [OPTIONS] SRC_PATH|- SERVICE:DEST_PATH
+usage: "docker compose cp [OPTIONS] SERVICE:SRC_PATH DEST_PATH|-\n\tdocker compose
+  cp [OPTIONS] SRC_PATH|- SERVICE:DEST_PATH"
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: all
-      value_type: bool
-      default_value: "false"
-      description: Copy to all the containers of the service.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: archive
-      shorthand: a
-      value_type: bool
-      default_value: "false"
-      description: Archive mode (copy all uid/gid information)
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: follow-link
-      shorthand: L
-      value_type: bool
-      default_value: "false"
-      description: Always follow symbol link in SRC_PATH
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: index
-      value_type: int
-      default_value: "1"
-      description: |
-        Index of the container if there are multiple instances of a service [default: 1].
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: all
+  value_type: bool
+  default_value: "false"
+  description: Copy to all the containers of the service.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: archive
+  shorthand: a
+  value_type: bool
+  default_value: "false"
+  description: Archive mode (copy all uid/gid information)
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: follow-link
+  shorthand: L
+  value_type: bool
+  default_value: "false"
+  description: Always follow symbol link in SRC_PATH
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: index
+  value_type: int
+  default_value: "1"
+  description: |
+    Index of the container if there are multiple instances of a service [default: 1].
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 38 - 38
docs/reference/docker_compose_create.yaml

@@ -5,44 +5,44 @@ usage: docker compose create [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: build
-      value_type: bool
-      default_value: "false"
-      description: Build images before starting containers.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: force-recreate
-      value_type: bool
-      default_value: "false"
-      description: |
-        Recreate containers even if their configuration and image haven't changed.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-build
-      value_type: bool
-      default_value: "false"
-      description: Don't build an image, even if it's missing.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-recreate
-      value_type: bool
-      default_value: "false"
-      description: |
-        If containers already exist, don't recreate them. Incompatible with --force-recreate.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: build
+  value_type: bool
+  default_value: "false"
+  description: Build images before starting containers.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: force-recreate
+  value_type: bool
+  default_value: "false"
+  description: |
+    Recreate containers even if their configuration and image haven't changed.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-build
+  value_type: bool
+  default_value: "false"
+  description: Don't build an image, even if it's missing.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-recreate
+  value_type: bool
+  default_value: "false"
+  description: |
+    If containers already exist, don't recreate them. Incompatible with --force-recreate.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 48 - 49
docs/reference/docker_compose_down.yaml

@@ -1,63 +1,62 @@
 command: docker compose down
 short: Stop and remove containers, networks
 long: |-
-    Stops containers and removes containers, networks, volumes, and images created by ``up`.
+  Stops containers and removes containers, networks, volumes, and images created by ``up`.
 
-    By default, the only things removed are:
+  By default, the only things removed are:
 
-    - Containers for services defined in the Compose file
-    - Networks defined in the networks section of the Compose file
-    - The default network, if one is used
+  - Containers for services defined in the Compose file
+  - Networks defined in the networks section of the Compose file
+  - The default network, if one is used
 
-    Networks and volumes defined as external are never removed.
+  Networks and volumes defined as external are never removed.
 
-    Anonymous volumes are not removed by default. However, as they don’t have a stable name, they will not be automatically
-    mounted by a subsequent `up`. For data that needs to persist between updates, use explicit paths as bind mounts or
-    named volumes.
+  Anonymous volumes are not removed by default. However, as they don’t have a stable name, they will not be automatically
+  mounted by a subsequent `up`. For data that needs to persist between updates, use explicit paths as bind mounts or
+  named volumes.
 usage: docker compose down
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: remove-orphans
-      value_type: bool
-      default_value: "false"
-      description: |
-        Remove containers for services not defined in the Compose file.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: rmi
-      value_type: string
-      description: |
-        Remove images used by services. "local" remove only images that don't have a custom tag ("local"|"all")
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: timeout
-      shorthand: t
-      value_type: int
-      default_value: "10"
-      description: Specify a shutdown timeout in seconds
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: volumes
-      shorthand: v
-      value_type: bool
-      default_value: "false"
-      description: |4
-         Remove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: remove-orphans
+  value_type: bool
+  default_value: "false"
+  description: Remove containers for services not defined in the Compose file.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: rmi
+  value_type: string
+  description: |
+    Remove images used by services. "local" remove only images that don't have a custom tag ("local"|"all")
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: timeout
+  shorthand: t
+  value_type: int
+  default_value: "10"
+  description: Specify a shutdown timeout in seconds
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: volumes
+  shorthand: v
+  value_type: bool
+  default_value: "false"
+  description: |
+    Remove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 25 - 25
docs/reference/docker_compose_events.yaml

@@ -1,38 +1,38 @@
 command: docker compose events
 short: Receive real time events from containers.
 long: |-
-    Stream container events for every container in the project.
+  Stream container events for every container in the project.
 
-    With the `--json` flag, a json object is printed one per line with the format:
+  With the `--json` flag, a json object is printed one per line with the format:
 
-    ```json
-    {
-        "time": "2015-11-20T18:01:03.615550",
-        "type": "container",
-        "action": "create",
-        "id": "213cf7...5fc39a",
-        "service": "web",
-        "attributes": {
-          "name": "application_web_1",
-          "image": "alpine:edge"
-        }
-    }
-    ```
+  ```json
+  {
+      "time": "2015-11-20T18:01:03.615550",
+      "type": "container",
+      "action": "create",
+      "id": "213cf7...5fc39a",
+      "service": "web",
+      "attributes": {
+        "name": "application_web_1",
+        "image": "alpine:edge"
+      }
+  }
+  ```
 
-    The events that can be received using this can be seen [here](https://docs.docker.com/engine/reference/commandline/events/#object-types).
+  The events that can be received using this can be seen [here](/engine/reference/commandline/events/#object-types).
 usage: docker compose events [options] [--] [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: json
-      value_type: bool
-      default_value: "false"
-      description: Output events as a stream of json objects
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: json
+  value_type: bool
+  default_value: "false"
+  description: Output events as a stream of json objects
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 73 - 69
docs/reference/docker_compose_exec.yaml

@@ -1,78 +1,82 @@
 command: docker compose exec
 short: Execute a command in a running container.
-long: "This is the equivalent of `docker exec` targeting a Compose service. \n\nWith this subcommand you can run arbitrary commands in your services. Commands are by default allocating a TTY, so \nyou can use a command such as `docker compose exec web sh` to get an interactive prompt."
+long: |-
+  This is the equivalent of `docker exec` targeting a Compose service.
+
+  With this subcommand you can run arbitrary commands in your services. Commands are by default allocating a TTY, so
+  you can use a command such as `docker compose exec web sh` to get an interactive prompt.
 usage: docker compose exec [options] [-e KEY=VAL...] [--] SERVICE COMMAND [ARGS...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: detach
-      shorthand: d
-      value_type: bool
-      default_value: "false"
-      description: 'Detached mode: Run command in the background.'
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: env
-      shorthand: e
-      value_type: stringArray
-      default_value: '[]'
-      description: Set environment variables
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: index
-      value_type: int
-      default_value: "1"
-      description: |
-        index of the container if there are multiple instances of a service [default: 1].
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-TTY
-      shorthand: T
-      value_type: bool
-      default_value: "false"
-      description: |
-        Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: privileged
-      value_type: bool
-      default_value: "false"
-      description: Give extended privileges to the process.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: user
-      shorthand: u
-      value_type: string
-      description: Run the command as this user.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: workdir
-      shorthand: w
-      value_type: string
-      description: Path to workdir directory for this command.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: detach
+  shorthand: d
+  value_type: bool
+  default_value: "false"
+  description: 'Detached mode: Run command in the background.'
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: env
+  shorthand: e
+  value_type: stringArray
+  default_value: '[]'
+  description: Set environment variables
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: index
+  value_type: int
+  default_value: "1"
+  description: |
+    index of the container if there are multiple instances of a service [default: 1].
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-TTY
+  shorthand: T
+  value_type: bool
+  default_value: "false"
+  description: |
+    Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: privileged
+  value_type: bool
+  default_value: "false"
+  description: Give extended privileges to the process.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: user
+  shorthand: u
+  value_type: string
+  description: Run the command as this user.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: workdir
+  shorthand: w
+  value_type: string
+  description: Path to workdir directory for this command.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 10 - 10
docs/reference/docker_compose_images.yaml

@@ -5,16 +5,16 @@ usage: docker compose images [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: quiet
-      shorthand: q
-      value_type: bool
-      default_value: "false"
-      description: Only display IDs
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: quiet
+  shorthand: q
+  value_type: bool
+  default_value: "false"
+  description: Only display IDs
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 14 - 14
docs/reference/docker_compose_kill.yaml

@@ -1,25 +1,25 @@
 command: docker compose kill
 short: Force stop service containers.
 long: |-
-    Forces running containers to stop by sending a `SIGKILL` signal. Optionally the signal can be passed, for example:
+  Forces running containers to stop by sending a `SIGKILL` signal. Optionally the signal can be passed, for example:
 
-    ```console
-    $ docker-compose kill -s SIGINT
-    ```
+  ```console
+  $ docker-compose kill -s SIGINT
+  ```
 usage: docker compose kill [options] [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: signal
-      shorthand: s
-      value_type: string
-      default_value: SIGKILL
-      description: SIGNAL to send to the container.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: signal
+  shorthand: s
+  value_type: string
+  default_value: SIGKILL
+  description: SIGNAL to send to the container.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 66 - 66
docs/reference/docker_compose_logs.yaml

@@ -5,72 +5,72 @@ usage: docker compose logs [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: follow
-      shorthand: f
-      value_type: bool
-      default_value: "false"
-      description: Follow log output.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-color
-      value_type: bool
-      default_value: "false"
-      description: Produce monochrome output.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-log-prefix
-      value_type: bool
-      default_value: "false"
-      description: Don't print prefix in logs.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: since
-      value_type: string
-      description: |
-        Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: tail
-      value_type: string
-      default_value: all
-      description: |
-        Number of lines to show from the end of the logs for each container.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: timestamps
-      shorthand: t
-      value_type: bool
-      default_value: "false"
-      description: Show timestamps.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: until
-      value_type: string
-      description: |
-        Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: follow
+  shorthand: f
+  value_type: bool
+  default_value: "false"
+  description: Follow log output.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-color
+  value_type: bool
+  default_value: "false"
+  description: Produce monochrome output.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-log-prefix
+  value_type: bool
+  default_value: "false"
+  description: Don't print prefix in logs.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: since
+  value_type: string
+  description: |
+    Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: tail
+  value_type: string
+  default_value: all
+  description: |
+    Number of lines to show from the end of the logs for each container.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: timestamps
+  shorthand: t
+  value_type: bool
+  default_value: "false"
+  description: Show timestamps.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: until
+  value_type: string
+  description: |
+    Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 37 - 37
docs/reference/docker_compose_ls.yaml

@@ -5,43 +5,43 @@ usage: docker compose ls
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: all
-      shorthand: a
-      value_type: bool
-      default_value: "false"
-      description: Show all stopped Compose projects
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: filter
-      value_type: filter
-      description: Filter output based on conditions provided.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: format
-      value_type: string
-      default_value: pretty
-      description: 'Format the output. Values: [pretty | json].'
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: quiet
-      shorthand: q
-      value_type: bool
-      default_value: "false"
-      description: Only display IDs.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: all
+  shorthand: a
+  value_type: bool
+  default_value: "false"
+  description: Show all stopped Compose projects
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: filter
+  value_type: filter
+  description: Filter output based on conditions provided.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: format
+  value_type: string
+  default_value: pretty
+  description: 'Format the output. Values: [pretty | json].'
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: quiet
+  shorthand: q
+  value_type: bool
+  default_value: "false"
+  description: Only display IDs.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 2 - 1
docs/reference/docker_compose_pause.yaml

@@ -1,6 +1,7 @@
 command: docker compose pause
 short: pause services
-long: Pauses running containers of a service. They can be unpaused with `docker compose unpause`.
+long: |
+  Pauses running containers of a service. They can be unpaused with `docker compose unpause`.
 usage: docker compose pause [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml

+ 18 - 18
docs/reference/docker_compose_port.yaml

@@ -5,24 +5,24 @@ usage: docker compose port [options] [--] SERVICE PRIVATE_PORT
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: index
-      value_type: int
-      default_value: "1"
-      description: index of the container if service has multiple replicas
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: protocol
-      value_type: string
-      default_value: tcp
-      description: tcp or udp
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: index
+  value_type: int
+  default_value: "1"
+  description: index of the container if service has multiple replicas
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: protocol
+  value_type: string
+  default_value: tcp
+  description: tcp or udp
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 64 - 56
docs/reference/docker_compose_ps.yaml

@@ -1,65 +1,73 @@
 command: docker compose ps
 short: List containers
-long: "Lists containers for a Compose project, with current status and exposed ports.\n\n```console\n$ docker compose ps\nNAME                SERVICE             STATUS              PORTS\nexample_foo_1       foo                 running (healthy)   0.0.0.0:8000->80/tcp\nexample_bar_1       bar                 exited (1)          \n```"
+long: |-
+  Lists containers for a Compose project, with current status and exposed ports.
+
+  ```console
+  $ docker compose ps
+  NAME                SERVICE             STATUS              PORTS
+  example_foo_1       foo                 running (healthy)   0.0.0.0:8000->80/tcp
+  example_bar_1       bar                 exited (1)
+  ```
 usage: docker compose ps [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: all
-      shorthand: a
-      value_type: bool
-      default_value: "false"
-      description: |
-        Show all stopped containers (including those created by the run command)
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: filter
-      value_type: string
-      description: Filter services by a property
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: format
-      value_type: string
-      default_value: pretty
-      description: 'Format the output. Values: [pretty | json]'
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: quiet
-      shorthand: q
-      value_type: bool
-      default_value: "false"
-      description: Only display IDs
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: services
-      value_type: bool
-      default_value: "false"
-      description: Display services
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: status
-      value_type: string
-      description: Filter services by status
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: all
+  shorthand: a
+  value_type: bool
+  default_value: "false"
+  description: |
+    Show all stopped containers (including those created by the run command)
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: filter
+  value_type: string
+  description: Filter services by a property
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: format
+  value_type: string
+  default_value: pretty
+  description: 'Format the output. Values: [pretty | json]'
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: quiet
+  shorthand: q
+  value_type: bool
+  default_value: "false"
+  description: Only display IDs
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: services
+  value_type: bool
+  default_value: "false"
+  description: Display services
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: status
+  value_type: string
+  description: Filter services by status
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 49 - 48
docs/reference/docker_compose_pull.yaml

@@ -1,57 +1,58 @@
 command: docker compose pull
 short: Pull service images
-long: "Pulls an image associated with a service defined in a `compose.yaml` file, but does not start containers based on \nthose images."
+long: |-
+  Pulls an image associated with a service defined in a `compose.yaml` file, but does not start containers based on
+  those images.
 usage: docker compose pull [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: ignore-pull-failures
-      value_type: bool
-      default_value: "false"
-      description: Pull what it can and ignores images with pull failures
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: include-deps
-      value_type: bool
-      default_value: "false"
-      description: Also pull services declared as dependencies
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-parallel
-      value_type: bool
-      default_value: "true"
-      description: DEPRECATED disable parallel pulling.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: parallel
-      value_type: bool
-      default_value: "true"
-      description: DEPRECATED pull multiple images in parallel.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: quiet
-      shorthand: q
-      value_type: bool
-      default_value: "false"
-      description: Pull without printing progress information
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-examples: "suppose you have this `compose.yaml`:\n\n```yaml\nservices:\n  db:\n    image: postgres\n  web:\n    build: .\n    command: bundle exec rails s -p 3000 -b '0.0.0.0'\n    volumes:\n      - .:/myapp\n    ports:\n      - \"3000:3000\"\n    depends_on:\n      - db\n```\n\nIf you run `docker compose pull ServiceName` in the same directory as the `compose.yaml` file that defines the service, \nDocker pulls the associated image. For example, to call the postgres image configured as the db service in our example, \nyou would run `docker compose pull db`.\n\n```console\n$ docker compose pull db\n[+] Running 1/15\n ⠸ db Pulling                                                             12.4s\n   ⠿ 45b42c59be33 Already exists                                           0.0s\n   ⠹ 40adec129f1a Downloading  3.374MB/4.178MB                             9.3s\n   ⠹ b4c431d00c78 Download complete                                        9.3s\n   ⠹ 2696974e2815 Download complete                                        9.3s\n   ⠹ 564b77596399 Downloading  5.622MB/7.965MB                             9.3s\n   ⠹ 5044045cf6f2 Downloading  216.7kB/391.1kB                             9.3s\n   ⠹ d736e67e6ac3 Waiting                                                  9.3s\n   ⠹ 390c1c9a5ae4 Waiting                                                  9.3s\n   ⠹ c0e62f172284 Waiting                                                  9.3s\n   ⠹ ebcdc659c5bf Waiting                                                  9.3s\n   ⠹ 29be22cb3acc Waiting                                                  9.3s\n   ⠹ f63c47038e66 Waiting                                                  9.3s\n   ⠹ 77a0c198cde5 Waiting                                                  9.3s\n   ⠹ c8752d5b785c Waiting                                                  9.3s\n``̀"
+- option: ignore-pull-failures
+  value_type: bool
+  default_value: "false"
+  description: Pull what it can and ignores images with pull failures
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: include-deps
+  value_type: bool
+  default_value: "false"
+  description: Also pull services declared as dependencies
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-parallel
+  value_type: bool
+  default_value: "true"
+  description: DEPRECATED disable parallel pulling.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: parallel
+  value_type: bool
+  default_value: "true"
+  description: DEPRECATED pull multiple images in parallel.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: quiet
+  shorthand: q
+  value_type: bool
+  default_value: "false"
+  description: Pull without printing progress information
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 23 - 23
docs/reference/docker_compose_push.yaml

@@ -1,37 +1,37 @@
 command: docker compose push
 short: Push service images
 long: |-
-    Pushes images for services to their respective registry/repository.
+  Pushes images for services to their respective registry/repository.
 
-    The following assumptions are made:
-    - You are pushing an image you have built locally
-    - You have access to the build key
+  The following assumptions are made:
+  - You are pushing an image you have built locally
+  - You have access to the build key
 
-    Examples
+  Examples
 
-    ```yaml
-    services:
-      service1:
-        build: .
-        image: localhost:5000/yourimage  ## goes to local registry
+  ```yaml
+  services:
+    service1:
+      build: .
+      image: localhost:5000/yourimage  ## goes to local registry
 
-      service2:
-        build: .
-        image: your-dockerid/yourimage  ## goes to your repository on Docker Hub
-    ```
+    service2:
+      build: .
+      image: your-dockerid/yourimage  ## goes to your repository on Docker Hub
+  ```
 usage: docker compose push [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: ignore-push-failures
-      value_type: bool
-      default_value: "false"
-      description: Push what it can and ignores images with push failures
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: ignore-push-failures
+  value_type: bool
+  default_value: "false"
+  description: Push what it can and ignores images with push failures
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 10 - 10
docs/reference/docker_compose_restart.yaml

@@ -5,16 +5,16 @@ usage: docker compose restart
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: timeout
-      shorthand: t
-      value_type: int
-      default_value: "10"
-      description: Specify a shutdown timeout in seconds
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: timeout
+  shorthand: t
+  value_type: int
+  default_value: "10"
+  description: Specify a shutdown timeout in seconds
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 51 - 51
docs/reference/docker_compose_rm.yaml

@@ -1,65 +1,65 @@
 command: docker compose rm
 short: Removes stopped service containers
 long: |-
-    Removes stopped service containers.
+  Removes stopped service containers.
 
-    By default, anonymous volumes attached to containers are not removed. You can override this with `-v`. To list all
-    volumes, use `docker volume ls`.
+  By default, anonymous volumes attached to containers are not removed. You can override this with `-v`. To list all
+  volumes, use `docker volume ls`.
 
-    Any data which is not in a volume is lost.
+  Any data which is not in a volume is lost.
 
-    Running the command with no options also removes one-off containers created by `docker compose run`:
+  Running the command with no options also removes one-off containers created by `docker compose run`:
 
-    ```console
-    $ docker compose rm
-    Going to remove djangoquickstart_web_run_1
-    Are you sure? [yN] y
-    Removing djangoquickstart_web_run_1 ... done
-    ```
+  ```console
+  $ docker compose rm
+  Going to remove djangoquickstart_web_run_1
+  Are you sure? [yN] y
+  Removing djangoquickstart_web_run_1 ... done
+  ```
 usage: docker compose rm [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: all
-      shorthand: a
-      value_type: bool
-      default_value: "false"
-      description: Deprecated - no effect
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: force
-      shorthand: f
-      value_type: bool
-      default_value: "false"
-      description: Don't ask to confirm removal
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: stop
-      shorthand: s
-      value_type: bool
-      default_value: "false"
-      description: Stop the containers, if required, before removing
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: volumes
-      shorthand: v
-      value_type: bool
-      default_value: "false"
-      description: Remove any anonymous volumes attached to containers
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: all
+  shorthand: a
+  value_type: bool
+  default_value: "false"
+  description: Deprecated - no effect
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: force
+  shorthand: f
+  value_type: bool
+  default_value: "false"
+  description: Don't ask to confirm removal
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: stop
+  shorthand: s
+  value_type: bool
+  default_value: "false"
+  description: Stop the containers, if required, before removing
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: volumes
+  shorthand: v
+  value_type: bool
+  default_value: "false"
+  description: Remove any anonymous volumes attached to containers
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

文件差異過大導致無法顯示
+ 0 - 0
docs/reference/docker_compose_run.yaml


+ 12 - 11
docs/reference/docker_compose_stop.yaml

@@ -1,20 +1,21 @@
 command: docker compose stop
 short: Stop services
-long: Stops running containers without removing them. They can be started again with `docker compose start`.
+long: |
+  Stops running containers without removing them. They can be started again with `docker compose start`.
 usage: docker compose stop [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: timeout
-      shorthand: t
-      value_type: int
-      default_value: "10"
-      description: Specify a shutdown timeout in seconds
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: timeout
+  shorthand: t
+  value_type: int
+  default_value: "10"
+  description: Specify a shutdown timeout in seconds
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 7 - 1
docs/reference/docker_compose_top.yaml

@@ -4,7 +4,13 @@ long: Displays the running processes.
 usage: docker compose top [SERVICES...]
 pname: docker compose
 plink: docker_compose.yaml
-examples: "```console\n$ docker compose top\nexample_foo_1\nUID    PID      PPID     C    STIME   TTY   TIME       CMD\nroot   142353   142331   2    15:33   ?     00:00:00   ping localhost -c 5 \n```"
+examples: |-
+  ```console
+  $ docker compose top
+  example_foo_1
+  UID    PID      PPID     C    STIME   TTY   TIME       CMD
+  root   142353   142331   2    15:33   ?     00:00:00   ping localhost -c 5
+  ```
 deprecated: false
 experimental: false
 experimentalcli: false

+ 207 - 193
docs/reference/docker_compose_up.yaml

@@ -1,202 +1,216 @@
 command: docker compose up
 short: Create and start containers
-long: "Builds, (re)creates, starts, and attaches to containers for a service.\n\nUnless they are already running, this command also starts any linked services.\n\nThe `docker compose up` command aggregates the output of each container (liked `docker compose logs --follow` does). \nWhen the command exits, all containers are stopped. Running `docker compose up --detach` starts the containers in the \nbackground and leaves them running.\n\nIf there are existing containers for a service, and the service’s configuration or image was changed after the \ncontainer’s creation, `docker compose up` picks up the changes by stopping and recreating the containers \n(preserving mounted volumes). To prevent Compose from picking up changes, use the `--no-recreate` flag.\n\nIf you want to force Compose to stop and recreate all containers, use the `--force-recreate` flag.\n\nIf the process encounters an error, the exit code for this command is `1`.\nIf the process is interrupted using `SIGINT` (ctrl + C) or `SIGTERM`, the containers are stopped, and the exit code is `0`."
+long: |-
+  Builds, (re)creates, starts, and attaches to containers for a service.
+
+  Unless they are already running, this command also starts any linked services.
+
+  The `docker compose up` command aggregates the output of each container (liked `docker compose logs --follow` does).
+  When the command exits, all containers are stopped. Running `docker compose up --detach` starts the containers in the
+  background and leaves them running.
+
+  If there are existing containers for a service, and the service’s configuration or image was changed after the
+  container’s creation, `docker compose up` picks up the changes by stopping and recreating the containers
+  (preserving mounted volumes). To prevent Compose from picking up changes, use the `--no-recreate` flag.
+
+  If you want to force Compose to stop and recreate all containers, use the `--force-recreate` flag.
+
+  If the process encounters an error, the exit code for this command is `1`.
+  If the process is interrupted using `SIGINT` (ctrl + C) or `SIGTERM`, the containers are stopped, and the exit code is `0`.
 usage: docker compose up [SERVICE...]
 pname: docker compose
 plink: docker_compose.yaml
 options:
-    - option: abort-on-container-exit
-      value_type: bool
-      default_value: "false"
-      description: |
-        Stops all containers if any container was stopped. Incompatible with -d
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: always-recreate-deps
-      value_type: bool
-      default_value: "false"
-      description: |
-        Recreate dependent containers. Incompatible with --no-recreate.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: attach
-      value_type: stringArray
-      default_value: '[]'
-      description: Attach to service output.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: attach-dependencies
-      value_type: bool
-      default_value: "false"
-      description: Attach to dependent containers.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: build
-      value_type: bool
-      default_value: "false"
-      description: Build images before starting containers.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: detach
-      shorthand: d
-      value_type: bool
-      default_value: "false"
-      description: 'Detached mode: Run containers in the background'
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: environment
-      shorthand: e
-      value_type: stringArray
-      default_value: '[]'
-      description: Environment variables
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: exit-code-from
-      value_type: string
-      description: |
-        Return the exit code of the selected service container. Implies --abort-on-container-exit
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: force-recreate
-      value_type: bool
-      default_value: "false"
-      description: |
-        Recreate containers even if their configuration and image haven't changed.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-build
-      value_type: bool
-      default_value: "false"
-      description: Don't build an image, even if it's missing.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-color
-      value_type: bool
-      default_value: "false"
-      description: Produce monochrome output.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-deps
-      value_type: bool
-      default_value: "false"
-      description: Don't start linked services.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-log-prefix
-      value_type: bool
-      default_value: "false"
-      description: Don't print prefix in logs.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-recreate
-      value_type: bool
-      default_value: "false"
-      description: |
-        If containers already exist, don't recreate them. Incompatible with --force-recreate.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: no-start
-      value_type: bool
-      default_value: "false"
-      description: Don't start the services after creating them.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: quiet-pull
-      value_type: bool
-      default_value: "false"
-      description: Pull without printing progress information.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: remove-orphans
-      value_type: bool
-      default_value: "false"
-      description: |
-        Remove containers for services not defined in the Compose file.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: renew-anon-volumes
-      shorthand: V
-      value_type: bool
-      default_value: "false"
-      description: |
-        Recreate anonymous volumes instead of retrieving data from the previous containers.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: scale
-      value_type: stringArray
-      default_value: '[]'
-      description: |
-        Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
-    - option: timeout
-      shorthand: t
-      value_type: int
-      default_value: "10"
-      description: |
-        Use this timeout in seconds for container shutdown when attached or when containers are already running.
-      deprecated: false
-      experimental: false
-      experimentalcli: false
-      kubernetes: false
-      swarm: false
+- option: abort-on-container-exit
+  value_type: bool
+  default_value: "false"
+  description: |
+    Stops all containers if any container was stopped. Incompatible with -d
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: always-recreate-deps
+  value_type: bool
+  default_value: "false"
+  description: Recreate dependent containers. Incompatible with --no-recreate.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: attach
+  value_type: stringArray
+  default_value: '[]'
+  description: Attach to service output.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: attach-dependencies
+  value_type: bool
+  default_value: "false"
+  description: Attach to dependent containers.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: build
+  value_type: bool
+  default_value: "false"
+  description: Build images before starting containers.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: detach
+  shorthand: d
+  value_type: bool
+  default_value: "false"
+  description: 'Detached mode: Run containers in the background'
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: environment
+  shorthand: e
+  value_type: stringArray
+  default_value: '[]'
+  description: Environment variables
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: exit-code-from
+  value_type: string
+  description: |
+    Return the exit code of the selected service container. Implies --abort-on-container-exit
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: force-recreate
+  value_type: bool
+  default_value: "false"
+  description: |
+    Recreate containers even if their configuration and image haven't changed.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-build
+  value_type: bool
+  default_value: "false"
+  description: Don't build an image, even if it's missing.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-color
+  value_type: bool
+  default_value: "false"
+  description: Produce monochrome output.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-deps
+  value_type: bool
+  default_value: "false"
+  description: Don't start linked services.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-log-prefix
+  value_type: bool
+  default_value: "false"
+  description: Don't print prefix in logs.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-recreate
+  value_type: bool
+  default_value: "false"
+  description: |
+    If containers already exist, don't recreate them. Incompatible with --force-recreate.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: no-start
+  value_type: bool
+  default_value: "false"
+  description: Don't start the services after creating them.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: quiet-pull
+  value_type: bool
+  default_value: "false"
+  description: Pull without printing progress information.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: remove-orphans
+  value_type: bool
+  default_value: "false"
+  description: Remove containers for services not defined in the Compose file.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: renew-anon-volumes
+  shorthand: V
+  value_type: bool
+  default_value: "false"
+  description: |
+    Recreate anonymous volumes instead of retrieving data from the previous containers.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: scale
+  value_type: stringArray
+  default_value: '[]'
+  description: |
+    Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
+- option: timeout
+  shorthand: t
+  value_type: int
+  default_value: "10"
+  description: |
+    Use this timeout in seconds for container shutdown when attached or when containers are already running.
+  deprecated: false
+  experimental: false
+  experimentalcli: false
+  kubernetes: false
+  swarm: false
 deprecated: false
 experimental: false
 experimentalcli: false

+ 7 - 56
docs/yaml/main/generate.go

@@ -18,32 +18,21 @@ package main
 
 import (
 	"fmt"
-	"io/ioutil"
-	"log"
 	"os"
 	"path/filepath"
-	"strings"
-
-	"github.com/spf13/cobra"
-	"github.com/spf13/pflag"
 
+	clidocstool "github.com/docker/cli-docs-tool"
 	"github.com/docker/compose/v2/cmd/compose"
-	. "github.com/docker/compose/v2/docs/yaml"
+	"github.com/spf13/cobra"
 )
 
-const descriptionSourcePath = "docs/reference/"
-
 func generateCliYaml(opts *options) error {
 	cmd := &cobra.Command{Use: "docker"}
 	cmd.AddCommand(compose.RootCommand(nil))
 	disableFlagsInUseLine(cmd)
-	source := filepath.Join(opts.source, descriptionSourcePath)
-	if err := loadLongDescription(cmd, source); err != nil {
-		return err
-	}
 
 	cmd.DisableAutoGenTag = true
-	return GenYamlTree(cmd, opts.target)
+	return clidocstool.GenYamlTree(cmd, opts.target)
 }
 
 func disableFlagsInUseLine(cmd *cobra.Command) {
@@ -63,54 +52,16 @@ func visitAll(root *cobra.Command, fn func(*cobra.Command)) {
 	fn(root)
 }
 
-func loadLongDescription(cmd *cobra.Command, path ...string) error {
-	for _, cmd := range cmd.Commands() {
-		if cmd.Name() == "" {
-			continue
-		}
-		fullpath := filepath.Join(path[0], strings.Join(append(path[1:], cmd.Name()), "_")+".md")
-
-		if cmd.HasSubCommands() {
-			if err := loadLongDescription(cmd, path[0], cmd.Name()); err != nil {
-				return err
-			}
-		}
-
-		if _, err := os.Stat(fullpath); err != nil {
-			log.Printf("WARN: %s does not exist, skipping\n", fullpath)
-			continue
-		}
-
-		content, err := ioutil.ReadFile(fullpath)
-		if err != nil {
-			return err
-		}
-		description, examples := ParseMDContent(string(content))
-		cmd.Long = description
-		cmd.Example = examples
-	}
-	return nil
-}
-
 type options struct {
 	source string
 	target string
 }
 
-func parseArgs() (*options, error) {
-	opts := &options{}
-	cwd, _ := os.Getwd()
-	flags := pflag.NewFlagSet(os.Args[0], pflag.ContinueOnError)
-	flags.StringVar(&opts.source, "root", cwd, "Path to project root")
-	flags.StringVar(&opts.target, "target", filepath.Join(cwd, "docs", "reference"), "Target path for generated yaml files")
-	err := flags.Parse(os.Args[1:])
-	return opts, err
-}
-
 func main() {
-	opts, err := parseArgs()
-	if err != nil {
-		fmt.Fprintln(os.Stderr, err.Error())
+	cwd, _ := os.Getwd()
+	opts := &options{
+		source: cwd,
+		target: filepath.Join(cwd, "docs", "reference"),
 	}
 	fmt.Printf("Project root: %s\n", opts.source)
 	fmt.Printf("Generating yaml files into %s\n", opts.target)

+ 0 - 290
docs/yaml/yaml.go

@@ -1,290 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package yaml
-
-import (
-	"fmt"
-	"io"
-	"os"
-	"path/filepath"
-	"sort"
-	"strings"
-
-	"github.com/spf13/cobra"
-	"github.com/spf13/pflag"
-	yaml "gopkg.in/yaml.v3"
-)
-
-type cmdOption struct {
-	Option          string
-	Shorthand       string `yaml:",omitempty"`
-	ValueType       string `yaml:"value_type,omitempty"`
-	DefaultValue    string `yaml:"default_value,omitempty"`
-	Description     string `yaml:",omitempty"`
-	Deprecated      bool
-	MinAPIVersion   string `yaml:"min_api_version,omitempty"`
-	Experimental    bool
-	ExperimentalCLI bool
-	Kubernetes      bool
-	Swarm           bool
-	OSType          string `yaml:"os_type,omitempty"`
-}
-
-type cmdDoc struct {
-	Name             string      `yaml:"command"`
-	SeeAlso          []string    `yaml:"parent,omitempty"`
-	Version          string      `yaml:"engine_version,omitempty"`
-	Aliases          string      `yaml:",omitempty"`
-	Short            string      `yaml:",omitempty"`
-	Long             string      `yaml:",omitempty"`
-	Usage            string      `yaml:",omitempty"`
-	Pname            string      `yaml:",omitempty"`
-	Plink            string      `yaml:",omitempty"`
-	Cname            []string    `yaml:",omitempty"`
-	Clink            []string    `yaml:",omitempty"`
-	Options          []cmdOption `yaml:",omitempty"`
-	InheritedOptions []cmdOption `yaml:"inherited_options,omitempty"`
-	Example          string      `yaml:"examples,omitempty"`
-	Deprecated       bool
-	MinAPIVersion    string `yaml:"min_api_version,omitempty"`
-	Experimental     bool
-	ExperimentalCLI  bool
-	Kubernetes       bool
-	Swarm            bool
-	OSType           string `yaml:"os_type,omitempty"`
-}
-
-// GenYamlTree creates yaml structured ref files
-func GenYamlTree(cmd *cobra.Command, dir string) error {
-	emptyStr := func(s string) string { return "" }
-	return GenYamlTreeCustom(cmd, dir, emptyStr)
-}
-
-// GenYamlTreeCustom creates yaml structured ref files
-func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string) error {
-	for _, c := range cmd.Commands() {
-		if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
-			continue
-		}
-		if err := GenYamlTreeCustom(c, dir, filePrepender); err != nil {
-			return err
-		}
-	}
-	if !cmd.HasParent() {
-		return nil
-	}
-
-	basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".yaml"
-	filename := filepath.Join(dir, basename)
-	f, err := os.Create(filename)
-	if err != nil {
-		return err
-	}
-	defer f.Close() //nolint: errcheck
-
-	if _, err := io.WriteString(f, filePrepender(filename)); err != nil {
-		return err
-	}
-	return GenYamlCustom(cmd, f)
-}
-
-// GenYamlCustom creates custom yaml output
-// nolint: gocyclo
-func GenYamlCustom(cmd *cobra.Command, w io.Writer) error {
-	cliDoc := cmdDoc{}
-	cliDoc.Name = cmd.CommandPath()
-
-	cliDoc.Aliases = strings.Join(cmd.Aliases, ", ")
-	cliDoc.Short = cmd.Short
-	cliDoc.Long = cmd.Long
-	if len(cliDoc.Long) == 0 {
-		cliDoc.Long = cliDoc.Short
-	}
-
-	if cmd.Runnable() {
-		cliDoc.Usage = cmd.UseLine()
-	}
-
-	if len(cmd.Example) > 0 {
-		cliDoc.Example = cmd.Example
-	}
-	if len(cmd.Deprecated) > 0 {
-		cliDoc.Deprecated = true
-	}
-	// Check recursively so that, e.g., `docker stack ls` returns the same output as `docker stack`
-	for curr := cmd; curr != nil; curr = curr.Parent() {
-		if v, ok := curr.Annotations["version"]; ok && cliDoc.MinAPIVersion == "" {
-			cliDoc.MinAPIVersion = v
-		}
-		if _, ok := curr.Annotations["experimental"]; ok && !cliDoc.Experimental {
-			cliDoc.Experimental = true
-		}
-		if _, ok := curr.Annotations["experimentalCLI"]; ok && !cliDoc.ExperimentalCLI {
-			cliDoc.ExperimentalCLI = true
-		}
-		if _, ok := curr.Annotations["kubernetes"]; ok && !cliDoc.Kubernetes {
-			cliDoc.Kubernetes = true
-		}
-		if _, ok := curr.Annotations["swarm"]; ok && !cliDoc.Swarm {
-			cliDoc.Swarm = true
-		}
-		if os, ok := curr.Annotations["ostype"]; ok && cliDoc.OSType == "" {
-			cliDoc.OSType = os
-		}
-	}
-
-	flags := cmd.NonInheritedFlags()
-	if flags.HasFlags() {
-		cliDoc.Options = genFlagResult(flags)
-	}
-	flags = cmd.InheritedFlags()
-	if flags.HasFlags() {
-		cliDoc.InheritedOptions = genFlagResult(flags)
-	}
-
-	if hasSeeAlso(cmd) {
-		if cmd.HasParent() {
-			parent := cmd.Parent()
-			cliDoc.Pname = parent.CommandPath()
-			link := cliDoc.Pname + ".yaml"
-			cliDoc.Plink = strings.Replace(link, " ", "_", -1)
-			cmd.VisitParents(func(c *cobra.Command) {
-				if c.DisableAutoGenTag {
-					cmd.DisableAutoGenTag = c.DisableAutoGenTag
-				}
-			})
-		}
-
-		children := cmd.Commands()
-		sort.Sort(byName(children))
-
-		for _, child := range children {
-			if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {
-				continue
-			}
-			currentChild := cliDoc.Name + " " + child.Name()
-			cliDoc.Cname = append(cliDoc.Cname, cliDoc.Name+" "+child.Name())
-			link := currentChild + ".yaml"
-			cliDoc.Clink = append(cliDoc.Clink, strings.Replace(link, " ", "_", -1))
-		}
-	}
-
-	final, err := yaml.Marshal(&cliDoc)
-	if err != nil {
-		fmt.Println(err)
-		os.Exit(1)
-	}
-	if _, err := fmt.Fprintln(w, string(final)); err != nil {
-		return err
-	}
-	return nil
-}
-
-func genFlagResult(flags *pflag.FlagSet) []cmdOption {
-	var (
-		result []cmdOption
-		opt    cmdOption
-	)
-
-	flags.VisitAll(func(flag *pflag.Flag) {
-		opt = cmdOption{
-			Option:       flag.Name,
-			ValueType:    flag.Value.Type(),
-			DefaultValue: forceMultiLine(flag.DefValue),
-			Description:  forceMultiLine(flag.Usage),
-			Deprecated:   len(flag.Deprecated) > 0,
-		}
-
-		// Todo, when we mark a shorthand is deprecated, but specify an empty message.
-		// The flag.ShorthandDeprecated is empty as the shorthand is deprecated.
-		// Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok.
-		if !(len(flag.ShorthandDeprecated) > 0) && len(flag.Shorthand) > 0 {
-			opt.Shorthand = flag.Shorthand
-		}
-		if _, ok := flag.Annotations["experimental"]; ok {
-			opt.Experimental = true
-		}
-		if v, ok := flag.Annotations["version"]; ok {
-			opt.MinAPIVersion = v[0]
-		}
-		if _, ok := flag.Annotations["experimentalCLI"]; ok {
-			opt.ExperimentalCLI = true
-		}
-		if _, ok := flag.Annotations["kubernetes"]; ok {
-			opt.Kubernetes = true
-		}
-		if _, ok := flag.Annotations["swarm"]; ok {
-			opt.Swarm = true
-		}
-
-		// Note that the annotation can have multiple ostypes set, however, multiple
-		// values are currently not used (and unlikely will).
-		//
-		// To simplify usage of the os_type property in the YAML, and for consistency
-		// with the same property for commands, we're only using the first ostype that's set.
-		if ostypes, ok := flag.Annotations["ostype"]; ok && len(opt.OSType) == 0 && len(ostypes) > 0 {
-			opt.OSType = ostypes[0]
-		}
-
-		result = append(result, opt)
-	})
-
-	return result
-}
-
-// Temporary workaround for yaml lib generating incorrect yaml with long strings
-// that do not contain \n.
-func forceMultiLine(s string) string {
-	if len(s) > 60 && !strings.Contains(s, "\n") {
-		s = s + "\n"
-	}
-	return s
-}
-
-// Small duplication for cobra utils
-func hasSeeAlso(cmd *cobra.Command) bool {
-	if cmd.HasParent() {
-		return true
-	}
-	for _, c := range cmd.Commands() {
-		if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
-			continue
-		}
-		return true
-	}
-	return false
-}
-
-// ParseMDContent parse markdown file looking for Description and Examples sections
-func ParseMDContent(mdString string) (description string, examples string) {
-	parsedContent := strings.Split(mdString, "\n## ")
-	for _, s := range parsedContent {
-		if strings.Index(s, "Description") == 0 {
-			description = strings.TrimSpace(strings.TrimPrefix(s, "Description"))
-		}
-		if strings.Index(s, "Examples") == 0 {
-			examples = strings.TrimSpace(strings.TrimPrefix(s, "Examples"))
-		}
-	}
-	return description, examples
-}
-
-type byName []*cobra.Command
-
-func (s byName) Len() int           { return len(s) }
-func (s byName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
-func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }

+ 1 - 1
go.mod

@@ -12,6 +12,7 @@ require (
 	github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e
 	github.com/docker/buildx v0.5.2-0.20210422185057-908a856079fc
 	github.com/docker/cli v20.10.7+incompatible
+	github.com/docker/cli-docs-tool v0.1.1
 	github.com/docker/docker v20.10.7+incompatible
 	github.com/docker/go-connections v0.4.0
 	github.com/docker/go-units v0.4.0
@@ -37,7 +38,6 @@ require (
 	github.com/stretchr/testify v1.7.0
 	github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
 	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
-	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
 	gotest.tools v2.2.0+incompatible
 	gotest.tools/v3 v3.0.3
 	k8s.io/client-go v0.21.0 // indirect

+ 2 - 0
go.sum

@@ -342,6 +342,8 @@ github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop
 github.com/docker/cli v20.10.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/cli v20.10.7+incompatible h1:pv/3NqibQKphWZiAskMzdz8w0PRbtTaEB+f6NwdU7Is=
 github.com/docker/cli v20.10.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
+github.com/docker/cli-docs-tool v0.1.1 h1:c6vuTMvogCkSFQCXIr6Mb4gFgUpdZ+28YMbCBfaQLik=
+github.com/docker/cli-docs-tool v0.1.1/go.mod h1:oMzPNt1wC3TcxuY22GMnOODNOxkwGH51gV3AhqAjFQ4=
 github.com/docker/compose-on-kubernetes v0.4.19-0.20190128150448-356b2919c496/go.mod h1:iT2pYfi580XlpaV4KmK0T6+4/9+XoKmk/fhoDod1emE=
 github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
 github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=

部分文件因文件數量過多而無法顯示