### Example configuration Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Example JSON configuration for an MCP client to connect to the Docker MCP gateway. ```json { "servers": { "MCP_DOCKER": { "command": "docker", "args": ["mcp", "gateway", "run", "--profile", "my_profile"], "type": "stdio" } } } ``` -------------------------------- ### Install Dependencies and Start Node.js Server Source: https://github.com/docker/docs/blob/main/content/guides/wiremock.md Run these console commands to install the required Node.js packages and then start the application server, which will listen for incoming requests. ```console npm install npm run start ``` -------------------------------- ### api examples Source: https://github.com/docker/docs/blob/main/content/manuals/ai/docker-agent/reference/cli.md Examples of starting the API server with different configurations. ```console $ docker agent serve api ./agent.yaml $ docker agent serve api ./agents/ --listen :9000 $ docker agent serve api docker.io/user/agent --pull-interval 10 ``` -------------------------------- ### Include Example Source: https://github.com/docker/docs/blob/main/COMPONENTS.md Example of using the include shortcode. ```markdown {{}} ``` -------------------------------- ### Run a Bootstrap Docker Daemon Instance Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/cli/docs/reference/dockerd.md Example script to start a separate Docker daemon instance with specific configurations for host, pidfile, iptables, IP masquerading, bridge, data-root, and exec-root, suitable for a bootstrap setup without network. ```console $ sudo dockerd \ -H unix:///var/run/docker-bootstrap.sock \ -p /var/run/docker-bootstrap.pid \ --iptables=false \ --ip-masq=false \ --bridge=none \ --data-root=/var/lib/docker-bootstrap \ --exec-root=/var/run/docker-bootstrap ``` -------------------------------- ### Set up .NET Solution and Projects Source: https://github.com/docker/docs/blob/main/content/guides/testcontainers-dotnet-getting-started/index.md Use these commands to create a new .NET solution, a class library for business logic, and an xUnit test project, then add project references. ```console $ dotnet new sln -o TestcontainersDemo $ cd TestcontainersDemo $ dotnet new classlib -o CustomerService $ dotnet sln add ./CustomerService/CustomerService.csproj $ dotnet new xunit -o CustomerService.Tests $ dotnet sln add ./CustomerService.Tests/CustomerService.Tests.csproj $ dotnet add ./CustomerService.Tests/CustomerService.Tests.csproj reference ./CustomerService/CustomerService.csproj ``` -------------------------------- ### Dockerfile with explicit root user Source: https://github.com/docker/docs/blob/main/content/manuals/scout/policy/_index.md Example Dockerfile where the root user is explicitly set. ```Dockerfile FROM alpine USER root RUN echo "Hi" ``` -------------------------------- ### Build command with attestations Source: https://github.com/docker/docs/blob/main/content/manuals/scout/policy/_index.md Example command to build and push an image with SBOM and provenance attestations. ```console $ docker buildx build --provenance=true --sbom=true -t --push . ``` -------------------------------- ### Build output Source: https://github.com/docker/docs/blob/main/content/manuals/docker-hub/quickstart.md Example output after successfully building the Docker image. ```console [+] Building 0.6s (6/6) FINISHED docker:desktop-linux => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 128B 0.0s => [internal] load metadata for docker.io/library/nginx:latest 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/2] FROM docker.io/library/nginx:latest 0.1s => [2/2] RUN echo "

Hello world from Docker!

" > /usr/share/ 0.2s => exporting to image 0.1s => => exporting layers 0.0s => => writing image sha256:f85ab68f4987847713e87a95c39009a5c9f4ad78 0.0s => => naming to docker.io/mobyismyname/nginx-custom 0.0s ``` -------------------------------- ### OpenCode: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```console $ opencode "{{% param "test_prompt" %}}" ``` -------------------------------- ### Push output Source: https://github.com/docker/docs/blob/main/content/manuals/docker-hub/quickstart.md Example output after successfully pushing the Docker image to Docker Hub. ```console Using default tag: latest The push refers to repository [docker.io/mobyismyname/nginx-custom] d0e011850342: Pushed e4e9e9ad93c2: Mounted from library/nginx 6ac729401225: Mounted from library/nginx 8ce189049cb5: Mounted from library/nginx 296af1bd2844: Mounted from library/nginx 63d7ce983cd5: Mounted from library/nginx b33db0c3c3a8: Mounted from library/nginx 98b5f35ea9d3: Mounted from library/nginx latest: digest: sha256:7f5223ae866e725a7f86b856c30edd3b86f60d76694df81d90b08918d8de1e3f size: 1985 ``` -------------------------------- ### Goose: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```plaintext {{% param "test_prompt" %}} ``` -------------------------------- ### Example: Build the Docker image Source: https://github.com/docker/docs/blob/main/content/get-started/introduction/build-and-push-first-image.md An example of building the Docker image using 'mobydock' as the Docker username. ```console $ docker build -t mobydock/getting-started-todo-app . ``` -------------------------------- ### Gemini: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```console $ gemini "{{% param test_prompt %}}" ``` -------------------------------- ### Continue: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```console $ cn "{{% param test_prompt %}}" ``` -------------------------------- ### Build your image Source: https://github.com/docker/docs/blob/main/content/manuals/docker-hub/quickstart.md Command to build and tag your Docker image for pushing to Docker Hub. ```console $ docker build -t /nginx-custom . ``` -------------------------------- ### Codex: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```console $ codex "{{% param test_prompt %}}" ``` -------------------------------- ### Launch command examples Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_launch.md Examples demonstrating how to use the 'docker model launch' command. ```bash docker model launch ``` ```bash docker model launch opencode ``` ```bash docker model launch claude -- --help ``` ```bash docker model launch openwebui --port 3000 ``` ```bash docker model launch claude --config ``` -------------------------------- ### Dockerfile with implicit root user Source: https://github.com/docker/docs/blob/main/content/manuals/scout/policy/_index.md Example Dockerfile that runs as root by default without explicit setting. ```Dockerfile FROM alpine RUN echo "Hi" ``` -------------------------------- ### Claude Desktop: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```plaintext {{% param test_prompt %}} ``` -------------------------------- ### Example Output: `docker ps` Source: https://github.com/docker/docs/blob/main/content/guides/reactjs/index.md An example output showing a running `docker-reactjs-sample-server` container. ```shell CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 88bced6ade95 docker-reactjs-sample-server "nginx -c /etc/nginx…" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp docker-reactjs-sample-server-1 ``` -------------------------------- ### Claude Code: Test Connection Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md Test the connection by submitting a prompt that invokes one of your installed MCP servers. ```console $ claude "{{% param test_prompt %}}" ``` -------------------------------- ### Example: `docker image ls` output Source: https://github.com/docker/docs/blob/main/content/get-started/introduction/build-and-push-first-image.md Sample output from `docker image ls` showing the built image. ```console REPOSITORY TAG IMAGE ID CREATED SIZE mobydock/getting-started-todo-app latest 1543656c9290 2 minutes ago 1.12GB ... ``` -------------------------------- ### Example iptables rule for encrypted overlay networks Source: https://github.com/docker/docs/blob/main/content/manuals/engine/swarm/swarm-tutorial/_index.md An example iptables rule to only accept encrypted packets on the Swarm data path port (4789 UDP) when encrypted overlay networks are in exclusive use. ```bash # Example iptables rule (order and other tools may require customization) iptables -I INPUT -m udp --dport 4789 -m policy --dir in --pol none -j DROP ``` -------------------------------- ### Example output of `docker ps` Source: https://github.com/docker/docs/blob/main/content/get-started/workshop/02_our_app.md Sample output showing a running `getting-started` container with its ID, image, command, status, ports, and name. ```console CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES df784548666d getting-started "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 127.0.0.1:3000->3000/tcp priceless_mcclintock ``` -------------------------------- ### OpenCode: Configuration File Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md The OpenCode configuration file (at `~/.config/opencode/opencode.json` by default) contains the setup for MCP Toolkit, showing `MCP_DOCKER` enabled. ```json { "mcp": { "MCP_DOCKER": { "type": "local", "command": ["docker", "mcp", "gateway", "run"], "enabled": true } }, "$schema": "https://opencode.ai/config.json" } ``` -------------------------------- ### Example configuration Source: https://github.com/docker/docs/blob/main/content/manuals/ai/docker-agent/reference/config.md Complete configuration demonstrating key features: ```yaml agents: root: model: claude description: Technical lead instruction: Coordinate development tasks and delegate to specialists sub_agents: [developer, reviewer] toolsets: - type: filesystem - type: mcp ref: docker:duckduckgo rag: [readmes] commands: status: "Check project status" developer: model: gpt description: Software developer instruction: Write clean, maintainable code toolsets: - type: filesystem - type: shell reviewer: model: claude description: Code reviewer instruction: Review for quality and security toolsets: - type: filesystem models: gpt: provider: openai model: gpt-5 claude: provider: anthropic model: claude-sonnet-4-5 max_tokens: 64000 rag: readmes: docs: ["**/README.md"] strategies: - type: chunked-embeddings embedding_model: openai/text-embedding-3-small vector_dimensions: 1536 database: ./embeddings.db limit: 10 - type: bm25 database: ./bm25.db limit: 10 results: fusion: strategy: rrf k: 60 limit: 5 ``` -------------------------------- ### Start a container - Example Request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.22.md Example HTTP request to start a container. ```HTTP POST /v1.22/containers/e90e34656806/start HTTP/1.1 ``` -------------------------------- ### Create example directory Source: https://github.com/docker/docs/blob/main/content/manuals/build/building/export.md Commands to create a new directory for the example and navigate into it. ```console $ mkdir hello-world-bin $ cd hello-world-bin ``` -------------------------------- ### Create a new directory for this tutorial Source: https://github.com/docker/docs/blob/main/content/manuals/build/policies/intro.md Commands to create a new directory named 'policy-tutorial' and navigate into it. ```console $ mkdir policy-tutorial $ cd policy-tutorial ``` -------------------------------- ### Start Container Example Request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.23.md Example HTTP request to start a Docker container. ```http POST /v1.23/containers/e90e34656806/start HTTP/1.1 ``` -------------------------------- ### Start a container - Example request and response Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.21.md Example HTTP request and response for starting a container. ```http POST /v1.21/containers/e90e34656806/start HTTP/1.1 ``` ```http HTTP/1.1 204 No Content ``` -------------------------------- ### Example Output: `docker images` Source: https://github.com/docker/docs/blob/main/content/guides/reactjs/index.md An example output showing details of a `docker-reactjs-sample` image. ```shell REPOSITORY TAG IMAGE ID CREATED SIZE docker-reactjs-sample latest f39b47a97156 14 seconds ago 75.8MB ``` -------------------------------- ### Start a container - Example Request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.3.md Example HTTP request to start a container with optional binds. ```HTTP POST /containers/(id)/start HTTP/1.1 Content-Type: application/json { "Binds":["/tmp:/tmp"] } ``` -------------------------------- ### Clone repository Source: https://github.com/docker/docs/blob/main/content/manuals/scout/quickstart.md Cloning the example project repository. ```console $ git clone https://github.com/docker/scout-demo-service.git ``` -------------------------------- ### Start a container - Example Response Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.12.md Example HTTP response for successfully starting a container. ```HTTP HTTP/1.1 204 No Content Content-Type: text/plain ``` -------------------------------- ### Create a Sample Bash Script Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/drivers/_index.md A simple bash script that prints 'Hello world', used as an application within the Docker image. ```bash #!/usr/bin/env bash echo "Hello world" ``` -------------------------------- ### Navigate to C++ Sample Application Directory Source: https://github.com/docker/docs/blob/main/content/guides/cpp/index.md Change the current directory to the `hello` subdirectory within the cloned repository to access the sample application files. ```bash cd c-plus-plus-docker/hello ``` -------------------------------- ### Start a container - Example Response Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.1.md Example HTTP response for successfully starting a container. ```http HTTP/1.1 200 OK ``` -------------------------------- ### Push your image to Docker Hub Source: https://github.com/docker/docs/blob/main/content/manuals/docker-hub/quickstart.md Command to push the Docker image to Docker Hub, creating a repository if it doesn't exist. ```console $ docker push /nginx-custom ``` -------------------------------- ### Start a container - Example Request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.1.md Example HTTP POST request to start a container. ```http POST /containers/e90e34656806/start HTTP/1.1 ``` -------------------------------- ### Test your image Source: https://github.com/docker/docs/blob/main/content/manuals/docker-hub/quickstart.md Command to run and test the newly built Docker image locally. ```console $ docker run -p 8080:80 --rm /nginx-custom ``` -------------------------------- ### Get the history of an image - Example request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.20.md Example HTTP request to get the history of an image. ```HTTP GET /v1.20/images/ubuntu/history HTTP/1.1 ``` -------------------------------- ### Clone the Example Go Application Repository Source: https://github.com/docker/docs/blob/main/content/guides/golang/index.md Use this command to clone the example Go application repository from GitHub to your local machine, which is required to follow the guide. ```console $ git clone https://github.com/docker/docker-gs-ping ``` -------------------------------- ### Get the history of an image - Example request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.18.md Example HTTP request to get the history of an image. ```http GET /v1.18/images/ubuntu/history HTTP/1.1 ``` -------------------------------- ### Example apt installation error message Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/linux/ubuntu.md An example of an `apt` error message that can be safely ignored after installing a downloaded DEB package. ```text N: Download is performed unsandboxed as root, as file '/home/user/Downloads/docker-desktop.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) ``` -------------------------------- ### Example output of docker images Source: https://github.com/docker/docs/blob/main/content/get-started/docker-concepts/the-basics/what-is-a-registry.md Shows the expected output after building the docker-quickstart image. ```console REPOSITORY TAG IMAGE ID CREATED SIZE /docker-quickstart latest 476de364f70e 2 minutes ago 170MB ``` -------------------------------- ### Start a container - Example request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.7.md Example HTTP POST request to start a container with host configuration. ```http POST /containers/(id)/start HTTP/1.1 Content-Type: application/json { "Binds":["/tmp:/tmp"], "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}], "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] }, "Privileged":false, "PublishAllPorts":false } ``` -------------------------------- ### Complete buildkitd.toml Configuration Example Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/buildkit/docs/buildkitd.toml.md This comprehensive example demonstrates various global and section-specific settings for the BuildKit daemon, including root path, entitlements, logging, DNS, gRPC, OCI worker, and history. Some options are for edge cases. ```toml # root is where all buildkit state is stored. root = "/var/lib/buildkit" # insecure-entitlements allows insecure entitlements, disabled by default. insecure-entitlements = [ "network.host", "security.insecure", "device" ] # proxyNetwork enables proxy network enforcement for all builds, disabled by default. # It can also be enabled with buildkitd --proxy-network. proxyNetwork = true # provenanceEnvDir is the directory where extra config is loaded that is added # to the provenance of builds: # slsa v0.2: invocation.environment.* # slsa v1: buildDefinition.internalParameters.* provenanceEnvDir = "/etc/buildkit/provenance.d" [log] # log formatter: json or text format = "text" # log level (error/warn/info/debug/trace) level = "info" [dns] nameservers=["1.1.1.1","8.8.8.8"] options=["edns0"] searchDomains=["example.com"] [grpc] address = [ "tcp://0.0.0.0:1234" ] # debugAddress is address for attaching go profiles and debuggers. debugAddress = "0.0.0.0:6060" uid = 0 gid = 0 [grpc.tls] cert = "/etc/buildkit/tls.crt" key = "/etc/buildkit/tls.key" ca = "/etc/buildkit/tlsca.crt" [otel] # OTEL collector trace socket path socketPath = "/run/buildkit/otel-grpc.sock" [cdi] # Disables support of the Container Device Interface (CDI). disabled = true # List of directories to scan for CDI spec files. For more details about CDI # specification, please refer to https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md#cdi-json-specification specDirs = ["/etc/cdi", "/var/run/cdi", "/etc/buildkit/cdi"] # config for build history API that stores information about completed build commands [history] # maxAge is the maximum age of history entries to keep, in seconds. maxAge = 172800 # maxEntries is the maximum number of history entries to keep. maxEntries = 50 [worker.oci] enabled = true # platforms is manually configure platforms, detected automatically if unset. platforms = [ "linux/amd64", "linux/arm64" ] snapshotter = "auto" # overlayfs or native, default value is "auto". rootless = false # see docs/rootless.md for the details on rootless mode. # Whether run subprocesses in main pid namespace or not, this is useful for # running rootless buildkit inside a container. noProcessSandbox = false # gc enables/disables garbage collection gc = true # reservedSpace is the minimum amount of disk space guaranteed to be # retained by this buildkit worker - any usage below this threshold will not # be reclaimed during garbage collection. # all disk space parameters can be an integer number of bytes (e.g. # 512000000), a string with a unit (e.g. "512MB"), or a string percentage # of the total disk space (e.g. "10%") reservedSpace = "30%" # maxUsedSpace is the maximum amount of disk space that may be used by # this buildkit worker - any usage above this threshold will be reclaimed # during garbage collection. maxUsedSpace = "60%" # minFreeSpace is the target amount of free disk space that the garbage # collector will attempt to leave - however, it will never be bought below # reservedSpace. minFreeSpace = "20GB" # alternate OCI worker binary name(example 'crun'), by default either # buildkit-runc or runc binary is used binary = "" # name of the apparmor profile that should be used to constrain build containers. # the profile should already be loaded (by a higher level system) before creating a worker. apparmor-profile = "" # limit the number of parallel build steps that can run at the same time max-parallelism = 4 # maintain a pool of reusable CNI network namespaces to amortize the overhead # of allocating and releasing the namespaces cniPoolSize = 16 [worker.oci.labels] "foo" = "bar" ``` -------------------------------- ### Example: Build with Dockerfile from stdin and local context Source: https://github.com/docker/docs/blob/main/content/manuals/build/concepts/context.md A complete example demonstrating how to create a directory, a file, and then build an image using the current directory as context and a Dockerfile passed through a here-document via stdin. ```bash # create a directory to work in mkdir example cd example # create an example file touch somefile.txt # build an image using the current directory as context # and a Dockerfile passed through stdin docker build -t myimage:latest -f- . </ \ --cache-to type=registry,ref=/[,parameters...] \ --cache-from type=registry,ref=/[,parameters...] . ``` -------------------------------- ### Initialize Node.js project Source: https://github.com/docker/docs/blob/main/content/manuals/ai/mcp-catalog-and-toolkit/e2b-sandboxes.md Create a new directory and initialize a Node.js project for the quickstart. ```console $ mkdir mcp-e2b-quickstart $ cd mcp-e2b-quickstart $ npm init -y ``` -------------------------------- ### Get container logs - Example request Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.20.md Example HTTP GET request to retrieve container logs with specific filters. ```HTTP GET /v1.20/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1 ```