docs: move base command to docker.md

CLI reference for the base command was generated to cli.md

Changed it to docker.md to handle broken links.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-01-19 14:42:09 +01:00
parent aff4649cb7
commit d633890f91
3 changed files with 88 additions and 107 deletions

View File

@ -10,104 +10,8 @@ aliases:
- /engine/reference/commandline/engine_update/
---
<!-- This file is maintained within the docker/cli GitHub
repository at https://github.com/docker/cli/. Make all
pull requests against that repo. If you see this file in
another repository, consider it read-only there, as it will
periodically be overwritten by the definitive file. Pull
requests which include edits to this file in other repositories
will be rejected.
-->
# docker
To list available commands, either run `docker` with no parameters
or execute `docker help`:
<!---MARKER_GEN_START-->
The base command for the Docker CLI.
### Subcommands
| Name | Description |
| :-------------------------------- | :---------------------------------------------------------------------------- |
| [`attach`](container_attach.md) | Attach local standard input, output, and error streams to a running container |
| [`build`](image_build.md) | Build an image from a Dockerfile |
| [`builder`](builder.md) | Manage builds |
| [`checkpoint`](checkpoint.md) | Manage checkpoints |
| [`commit`](container_commit.md) | Create a new image from a container's changes |
| [`config`](config.md) | Manage Swarm configs |
| [`container`](container.md) | Manage containers |
| [`context`](context.md) | Manage contexts |
| [`cp`](container_cp.md) | Copy files/folders between a container and the local filesystem |
| [`create`](container_create.md) | Create a new container |
| [`diff`](container_diff.md) | Inspect changes to files or directories on a container's filesystem |
| [`events`](system_events.md) | Get real time events from the server |
| [`exec`](container_exec.md) | Execute a command in a running container |
| [`export`](container_export.md) | Export a container's filesystem as a tar archive |
| [`history`](image_history.md) | Show the history of an image |
| [`image`](image.md) | Manage images |
| [`images`](image_ls.md) | List images |
| [`import`](image_import.md) | Import the contents from a tarball to create a filesystem image |
| [`info`](system_info.md) | Display system-wide information |
| [`inspect`](inspect.md) | Return low-level information on Docker objects |
| [`kill`](container_kill.md) | Kill one or more running containers |
| [`load`](image_load.md) | Load an image from a tar archive or STDIN |
| [`login`](login.md) | Log in to a registry |
| [`logout`](logout.md) | Log out from a registry |
| [`logs`](container_logs.md) | Fetch the logs of a container |
| [`manifest`](manifest.md) | Manage Docker image manifests and manifest lists |
| [`network`](network.md) | Manage networks |
| [`node`](node.md) | Manage Swarm nodes |
| [`pause`](container_pause.md) | Pause all processes within one or more containers |
| [`plugin`](plugin.md) | Manage plugins |
| [`port`](container_port.md) | List port mappings or a specific mapping for the container |
| [`ps`](container_ls.md) | List containers |
| [`pull`](image_pull.md) | Download an image from a registry |
| [`push`](image_push.md) | Upload an image to a registry |
| [`rename`](container_rename.md) | Rename a container |
| [`restart`](container_restart.md) | Restart one or more containers |
| [`rm`](container_rm.md) | Remove one or more containers |
| [`rmi`](image_rm.md) | Remove one or more images |
| [`run`](container_run.md) | Create and run a new container from an image |
| [`save`](image_save.md) | Save one or more images to a tar archive (streamed to STDOUT by default) |
| [`search`](search.md) | Search Docker Hub for images |
| [`secret`](secret.md) | Manage Swarm secrets |
| [`service`](service.md) | Manage Swarm services |
| [`stack`](stack.md) | Manage Swarm stacks |
| [`start`](container_start.md) | Start one or more stopped containers |
| [`stats`](container_stats.md) | Display a live stream of container(s) resource usage statistics |
| [`stop`](container_stop.md) | Stop one or more running containers |
| [`swarm`](swarm.md) | Manage Swarm |
| [`system`](system.md) | Manage Docker |
| [`tag`](image_tag.md) | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE |
| [`top`](container_top.md) | Display the running processes of a container |
| [`trust`](trust.md) | Manage trust on Docker images |
| [`unpause`](container_unpause.md) | Unpause all processes within one or more containers |
| [`update`](container_update.md) | Update configuration of one or more containers |
| [`version`](version.md) | Show the Docker version information |
| [`volume`](volume.md) | Manage volumes |
| [`wait`](container_wait.md) | Block until one or more containers stop, then print their exit codes |
### Options
| Name | Type | Default | Description |
|:---------------------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
| `--config` | `string` | `/root/.docker` | Location of client config files |
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
| `-D`, `--debug` | | | Enable debug mode |
| [`-H`](#host), [`--host`](#host) | `list` | | Daemon socket to connect to |
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
| `--tls` | | | Use TLS; implied by --tlsverify |
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
| `--tlsverify` | | | Use TLS and verify the remote |
<!---MARKER_GEN_END-->
## Description
The base command for the Docker CLI is `docker`. For information about the
available flags and subcommands, refer to the [CLI reference](docker.md)
Depending on your Docker system configuration, you may be required to preface
each `docker` command with `sudo`. To avoid having to use `sudo` with the

View File

@ -0,0 +1,86 @@
# docker
<!---MARKER_GEN_START-->
The base command for the Docker CLI.
### Subcommands
| Name | Description |
|:------------------------------|:------------------------------------------------------------------------------|
| [`attach`](attach.md) | Attach local standard input, output, and error streams to a running container |
| [`build`](build.md) | Build an image from a Dockerfile |
| [`builder`](builder.md) | Manage builds |
| [`checkpoint`](checkpoint.md) | Manage checkpoints |
| [`commit`](commit.md) | Create a new image from a container's changes |
| [`config`](config.md) | Manage Swarm configs |
| [`container`](container.md) | Manage containers |
| [`context`](context.md) | Manage contexts |
| [`cp`](cp.md) | Copy files/folders between a container and the local filesystem |
| [`create`](create.md) | Create a new container |
| [`diff`](diff.md) | Inspect changes to files or directories on a container's filesystem |
| [`events`](events.md) | Get real time events from the server |
| [`exec`](exec.md) | Execute a command in a running container |
| [`export`](export.md) | Export a container's filesystem as a tar archive |
| [`history`](history.md) | Show the history of an image |
| [`image`](image.md) | Manage images |
| [`images`](images.md) | List images |
| [`import`](import.md) | Import the contents from a tarball to create a filesystem image |
| [`info`](info.md) | Display system-wide information |
| [`inspect`](inspect.md) | Return low-level information on Docker objects |
| [`kill`](kill.md) | Kill one or more running containers |
| [`load`](load.md) | Load an image from a tar archive or STDIN |
| [`login`](login.md) | Log in to a registry |
| [`logout`](logout.md) | Log out from a registry |
| [`logs`](logs.md) | Fetch the logs of a container |
| [`manifest`](manifest.md) | Manage Docker image manifests and manifest lists |
| [`network`](network.md) | Manage networks |
| [`node`](node.md) | Manage Swarm nodes |
| [`pause`](pause.md) | Pause all processes within one or more containers |
| [`plugin`](plugin.md) | Manage plugins |
| [`port`](port.md) | List port mappings or a specific mapping for the container |
| [`ps`](ps.md) | List containers |
| [`pull`](pull.md) | Download an image from a registry |
| [`push`](push.md) | Upload an image to a registry |
| [`rename`](rename.md) | Rename a container |
| [`restart`](restart.md) | Restart one or more containers |
| [`rm`](rm.md) | Remove one or more containers |
| [`rmi`](rmi.md) | Remove one or more images |
| [`run`](run.md) | Create and run a new container from an image |
| [`save`](save.md) | Save one or more images to a tar archive (streamed to STDOUT by default) |
| [`search`](search.md) | Search Docker Hub for images |
| [`secret`](secret.md) | Manage Swarm secrets |
| [`service`](service.md) | Manage Swarm services |
| [`stack`](stack.md) | Manage Swarm stacks |
| [`start`](start.md) | Start one or more stopped containers |
| [`stats`](stats.md) | Display a live stream of container(s) resource usage statistics |
| [`stop`](stop.md) | Stop one or more running containers |
| [`swarm`](swarm.md) | Manage Swarm |
| [`system`](system.md) | Manage Docker |
| [`tag`](tag.md) | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE |
| [`top`](top.md) | Display the running processes of a container |
| [`trust`](trust.md) | Manage trust on Docker images |
| [`unpause`](unpause.md) | Unpause all processes within one or more containers |
| [`update`](update.md) | Update configuration of one or more containers |
| [`version`](version.md) | Show the Docker version information |
| [`volume`](volume.md) | Manage volumes |
| [`wait`](wait.md) | Block until one or more containers stop, then print their exit codes |
### Options
| Name | Type | Default | Description |
|:--------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
| `--config` | `string` | `/root/.docker` | Location of client config files |
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
| `-D`, `--debug` | | | Enable debug mode |
| `-H`, `--host` | `list` | | Daemon socket to connect to |
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
| `--tls` | | | Use TLS; implied by --tlsverify |
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
| `--tlsverify` | | | Use TLS and verify the remote |
<!---MARKER_GEN_END-->

View File

@ -8,9 +8,6 @@ export GO111MODULE=auto
function clean {
rm -rf "$buildir"
if [ -f "$(pwd)/docs/reference/commandline/docker.md" ]; then
mv "$(pwd)/docs/reference/commandline/docker.md" "$(pwd)/docs/reference/commandline/cli.md"
fi
}
buildir=$(mktemp -d -t docker-cli-docsgen.XXXXXXXXXX)
@ -32,12 +29,6 @@ trap clean EXIT
go build -mod=vendor -modfile=vendor.mod -tags docsgen -o /tmp/docsgen ./docs/generate/generate.go
)
# yaml generation on docs repo needs the cli.md file: https://github.com/docker/cli/pull/3924#discussion_r1059986605
# but markdown generation docker.md atm. While waiting for a fix in cli-docs-tool
# we need to first move the cli.md file to docker.md, do the generation and
# then move it back in trap handler.
mv "$(pwd)/docs/reference/commandline/cli.md" "$(pwd)/docs/reference/commandline/docker.md"
(
set -x
/tmp/docsgen --formats md --source "$(pwd)/docs/reference/commandline" --target "$(pwd)/docs/reference/commandline"