### Generate Docker Buildx Docs Source: https://github.com/docker/cli-docs-tool/blob/main/example/README.md This snippet demonstrates the process of cloning the documentation tool repository, navigating to the example directory, downloading Go modules, and executing the documentation generation script. The generated documentation will be saved in the './docs' directory. ```console git clone https://github.com/docker/cli-docs-tool cd cli-docs-tool/example/ go mod download go run main.go ``` -------------------------------- ### Generate Docker CLI Documentation Source: https://github.com/docker/cli-docs-tool/blob/main/README.md This Go code snippet shows how to use the docker/cli-docs-tool library to generate documentation for Docker CLI commands. The example focuses on generating both Markdown and YAML formats for various 'docker buildx' subcommands. ```go package main import ( "context" "fmt" "github.com/docker/cli-docs-tool" "github.com/docker/cli/cli/command" ) func main() { ctx := context.Background() // Example: Generate Markdown documentation cliDocsTool := cli_docs_tool.NewCLIDocsTool(cli_docs_tool.WithMarkdownOutput("./docs/markdown")) // Replace with actual Docker CLI commands you want to document cliDocsTool.GenerateDocs(ctx, "docker buildx", "buildx", []string{ "bake", "build", "create", "du", "inspect", "ls", "rm", "stop", "use", "version", }) // Example: Generate YAML documentation cliDocsToolYAML := cli_docs_tool.NewCLIDocsTool(cli_docs_tool.WithYAMLOutput("./docs/yaml")) cliDocsToolYAML.GenerateDocs(ctx, "docker buildx", "buildx", []string{ "uninstall", "use", "version", "buildx", }) fmt.Println("Documentation generation complete.") } ``` ```console $ go run main.go INFO: Generating Markdown for "docker buildx bake" INFO: Generating Markdown for "docker buildx build" INFO: Generating Markdown for "docker buildx create" INFO: Generating Markdown for "docker buildx du" ... INFO: Generating YAML for "docker buildx uninstall" INFO: Generating YAML for "docker buildx use" INFO: Generating YAML for "docker buildx version" INFO: Generating YAML for "docker buildx" ``` -------------------------------- ### Initialize Go Submodule for Docker CLI Docs Source: https://github.com/docker/cli-docs-tool/blob/main/README.md This snippet demonstrates how to set up a Go submodule within a 'docs' folder to generate documentation for the Docker CLI using the cli-docs-tool library. It includes initializing the Go module, fetching the library, and updating the go.mod file. ```console mkdir docs cd ./docs go mod init github.com/docker/buildx/docs go get github.com/docker/cli-docs-tool ``` ```text module github.com/docker/buildx/docs go 1.16 require ( github.com/docker/cli-docs-tool v0.0.0 ) ``` -------------------------------- ### Docker CLI Subcommands Overview Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/docker.md A list of available subcommands for the Docker CLI, each with a brief description of its functionality. Links to detailed documentation for each subcommand are provided. ```dockercli Subcommands: attach Attach local standard input, output, and error streams to a running container buildx Docker Buildx ``` -------------------------------- ### Docker Buildx Subcommands Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx.md Lists the available subcommands for Docker Buildx, detailing their purpose. ```APIDOC build: description: Start a build link: buildx_build.md dial-stdio: description: Proxy current stdio streams to builder instance link: buildx_dial-stdio.md stop: description: Stop builder instance link: buildx_stop.md ``` -------------------------------- ### Docker Buildx Options Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx.md Details the configuration options available for Docker Buildx commands. ```APIDOC --builder: type: string default: "" description: Override the configured builder instance ``` -------------------------------- ### Docker Buildx Dial Stdio Options Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx_dial-stdio.md Configures the `docker buildx dial-stdio` command, allowing users to specify the builder instance, target platform, and progress output type. ```APIDOC docker buildx dial-stdio Proxy current stdio streams to builder instance Options: --builder string Override the configured builder instance --platform string Target platform: this is used for node selection --progress string (Default: "quiet") Set type of progress output (auto, plain, tty). ``` -------------------------------- ### Docker Buildx Build Command Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx_build.md Initiates a build process using Docker Buildx. This command supports various options for configuring the build, including specifying the build context, Dockerfile, tags, and more. It is a powerful tool for building container images efficiently. ```bash docker buildx build [OPTIONS] PATH | URL | - Aliases: docker image build, docker buildx build, docker buildx b, docker build ``` -------------------------------- ### Docker Build Command Options Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx_build.md This section details various command-line options for the Docker build command. It covers output destinations, platform targeting, image tagging, secret management, and build stage specification. ```APIDOC -o, --output stringArray Output destination (format: `type=local,dest=path`) --platform stringArray Set target platform for build --push Shorthand for `--output=type=registry` -q, --quiet Suppress the build output and print image ID on success --secret stringArray Secret file to expose to the build (format: `id=mysecret,src=/local/secret`) --shm-size string Size of `/dev/shm` --ssh stringArray SSH agent socket or keys to expose to the build format: `default|[=|[,]]` -t, --tag stringArray Name and optionally a tag (format: `name:tag`) --target string Set the target build stage to build. --ulimit string Ulimit options ``` -------------------------------- ### Docker Build Command Options Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx_build.md This section details the various options available for the `docker build` command. These options control aspects like host-to-IP mapping, build-time variables, cache management, networking, and metadata. ```APIDOC Docker Build Options: --add-host stringSlice Add a custom host-to-IP mapping (format: host:ip) --allow stringSlice Allow extra privileged entitlement (e.g., network.host, security.insecure) --build-arg stringArray Set build-time variables --builder string Override the configured builder instance --cache-from stringArray External cache sources (e.g., user/app:cache, type=local,src=path/to/dir) --cache-to stringArray Cache export destinations (e.g., user/app:cache, type=local,dest=path/to/dir) --cgroup-parent string Optional parent cgroup for the container --detach bool Dummy flag that tests boolean flags with true as default -f, --file string Name of the Dockerfile (default: PATH/Dockerfile) --iidfile string Write the image ID to the file --label stringArray Set metadata for an image --load bool Shorthand for --output=type=docker --network string Set the networking mode for the RUN instructions during build (default: default) ``` -------------------------------- ### Docker Attach Command Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/attach.md Attaches local standard input, output, and error streams to a running container. This command is useful for interacting with a container's processes in real-time. ```APIDOC docker attach [OPTIONS] CONTAINER Attach local standard input, output, and error streams to a running container Aliases: docker container attach, docker attach Options: --detach-keys string Override the key sequence for detaching a container --no-stdin Do not attach STDIN --sig-proxy Proxy all received signals to the process (default true) ``` -------------------------------- ### Docker CLI Global Options Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/docker.md Global options that can be used with any Docker command to configure the connection to the Docker daemon. The `-H` or `--host` option specifies the daemon socket to connect to. ```dockercli Options: -H, --host string Daemon socket to connect to (default "unix:///var/run/docker.sock") ``` -------------------------------- ### docker buildx stop Command Source: https://github.com/docker/cli-docs-tool/blob/main/fixtures/buildx_stop.md Stops a builder instance. Allows overriding the configured builder instance using the --builder option. ```APIDOC docker buildx stop Stop builder instance Options: --builder string Override the configured builder instance ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.