### Install Docker Desktop using Windows Command Prompt Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/windows-install.md Executes the installer from the Windows Command Prompt using `start /w` to wait for the installer to finish. Includes syntax for both per-user and all-users installation modes. ```sh # Per-user installation (no admin required) start /w "" "Docker Desktop Installer.exe" install --user # All-users installation (run as administrator) start /w "" "Docker Desktop Installer.exe" install ``` -------------------------------- ### Install dependencies and start the Node server Source: https://github.com/docker/docs/blob/main/content/guides/wiremock.md Installs the required npm packages and boots the Node.js application listening on port 5001. ```console npm install npm run start ``` ```plaintext > express-api-starter@1.2.0 start > node src/index.js API_ENDPOINT_BASE: http://localhost:8080 .. Listening: http://localhost:5001 ``` -------------------------------- ### Install Docker Desktop using PowerShell Start-Process Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/windows-install.md Executes the installer in PowerShell using `Start-Process` with the `-Wait` parameter to block until installation completes. Includes commands for both per-user and all-users installation modes. ```powershell # Per-user installation (no admin required) Start-Process 'Docker Desktop Installer.exe' -Wait -ArgumentList 'install', '--user' # All-users installation (run as administrator) Start-Process 'Docker Desktop Installer.exe' -Wait install ``` -------------------------------- ### Install the Go SDK using go get Source: https://github.com/docker/docs/blob/main/content/reference/api/engine/sdk/_index.md Installs the Docker Engine Go client package. Ensure a currently supported version of Go is running before installation. ```console $ go get github.com/moby/moby/client ``` -------------------------------- ### Install interactively without verbose logging Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/enterprise/enterprise-deployment/msi-install-and-configure.md Starts the standard interactive MSI installation of Docker Desktop with the graphical user interface. Requires administrator rights. ```powershell msiexec /i "DockerDesktop.msi" ``` -------------------------------- ### Chain multiple sequential pre_start steps Source: https://github.com/docker/docs/blob/main/content/manuals/compose/how-tos/init-containers.md Executes multiple setup steps in declared sequence, ensuring the application starts only after both the migration and fixture loading exit with code 0. ```yaml services: app: image: myapp:latest depends_on: db: condition: service_healthy pre_start: - command: ["./manage.py", "migrate"] - command: ["./manage.py", "loaddata", "fixtures.json"] db: image: postgres:18 ``` -------------------------------- ### Clone the Docker Scout demo repository Source: https://github.com/docker/docs/blob/main/content/manuals/scout/quickstart.md Clone the example vulnerable Node.js application repository used to follow along with the Docker Scout quickstart guide. ```console $ git clone https://github.com/docker/scout-demo-service.git ``` -------------------------------- ### Create a directory for the policy tutorial Source: https://github.com/docker/docs/blob/main/content/manuals/build/policies/intro.md Sets up and enters a dedicated directory for creating the tutorial Dockerfile and policy file. ```console $ mkdir policy-tutorial $ cd policy-tutorial ``` -------------------------------- ### Configure worktree_create hook to seed environment and install dependencies Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/configuration/hooks/index.md Runs setup commands inside a freshly created git worktree checkout before the agent session starts. Uses worktree_source_dir to copy untracked files and aborts the run on setup failure using exit code 2. ```yaml hooks: worktree_create: # Copy untracked dotfiles git won't bring into the new worktree. - name: seed local env type: command command: | INPUT=$(cat) SRC=$(echo "$INPUT" | jq -r '.worktree_source_dir // ""') [ -n "$SRC" ] && [ -f "$SRC/.env" ] && [ ! -f .env ] && cp "$SRC/.env" .env echo "Prepared worktree" # Install dependencies, aborting the run on failure. - name: install dependencies type: command timeout: 600 command: | if [ -f package.json ]; then npm install || { echo '{"continue": false, "system_message": "npm install failed"}'; exit 2; } fi ``` -------------------------------- ### Launch the interactive getting-started tour Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/getting-started/quickstart/index.md Starts a scripted onboarding tour inside the chat UI to demonstrate messages, tool approval, and commands. ```bash $ docker agent getting-started ``` -------------------------------- ### Start Docker manually with systemctl start Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/ubuntu.md If Docker is not running after installation, run this command to start the Docker service manually. ```console $ sudo systemctl start docker ``` -------------------------------- ### Start OpenCode Source: https://github.com/docker/docs/blob/main/content/guides/opencode-model-runner.md Run this command from your project directory to launch OpenCode. ```console $ opencode ``` -------------------------------- ### Clone example repository Source: https://github.com/docker/docs/blob/main/content/guides/bake.md Clone the example repository containing the Dockerfile and docker-bake.hcl setup. ```bash git clone https://github.com/dvdksn/bakeme.git cd bakeme ``` -------------------------------- ### Install docker-ce-rootless-extras via apt-get Source: https://github.com/docker/docs/blob/main/content/manuals/engine/security/rootless/_index.md Installs the rootless setup extras package manually if dockerd-rootless-setuptool.sh is missing. ```console $ sudo apt-get install -y docker-ce-rootless-extras ``` -------------------------------- ### Run interactive setup for custom OpenAI-compatible endpoint Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/getting-started/set-up-a-model/index.md Launches the interactive setup wizard to configure a custom OpenAI-compatible endpoint. ```bash $ docker agent setup # pick "Custom OpenAI-compatible endpoint" ``` -------------------------------- ### Initialize Node.js app and install dependencies Source: https://github.com/docker/docs/blob/main/content/guides/opentelemetry.md Create the app subdirectory, initialize a package.json file, and install Express along with OpenTelemetry SDK and instrumentation packages. ```bash mkdir app && cd app npm init -y npm install express @opentelemetry/api @opentelemetry/sdk-node \ @opentelemetry/auto-instrumentations-node \ @opentelemetry/exporter-trace-otlp-http ``` -------------------------------- ### Install extension in Docker Desktop with docker extension install Source: https://github.com/docker/docs/blob/main/content/manuals/extensions/extensions-sdk/quickstart.md Installs the extension image into Docker Desktop. After installation finishes, open the extension frontend using the Quickstart item under the Extensions menu. ```console $ docker extension install ``` -------------------------------- ### POST /v1/sandboxes/{sandbox}/start Source: https://github.com/docker/docs/blob/main/_autodocs/endpoints.md Starts an existing sandbox. ```APIDOC ## POST /v1/sandboxes/{sandbox}/start ### Description Start sandbox. ### Method POST ### Endpoint /v1/sandboxes/{sandbox}/start ### Authentication bearer ### Parameters #### Path Parameters - **sandbox** (string) - Required - Identifier of the sandbox. ``` -------------------------------- ### Clone the sample application repository Source: https://github.com/docker/docs/blob/main/content/get-started/docker-concepts/building-images/build-tag-and-publish-an-image.md Clones the getting-started todo app sample repository to your local machine using Git. ```console $ git clone https://github.com/docker/getting-started-todo-app ``` -------------------------------- ### Navigate to the hello directory and inspect files Source: https://github.com/docker/docs/blob/main/content/guides/cpp.md Changes directory into the sample hello project and lists the directory contents. ```bash $ cd c-plus-plus-docker/hello $ ls ``` ```text Dockerfile hello.cpp ``` -------------------------------- ### Interactively configure model providers with docker agent setup Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md Launches the interactive setup wizard to configure built-in cloud providers, local models, custom OpenAI-compatible endpoints, or the Claude Code harness. ```bash $ docker agent setup ``` -------------------------------- ### Start rootless daemon with systemctl Source: https://github.com/docker/docs/blob/main/content/manuals/engine/security/rootless/tips.md Starts the rootless Docker systemd user service. Use this when rootless Docker was installed with systemd support. ```console $ systemctl --user start docker ``` -------------------------------- ### Initialize Go module Source: https://github.com/docker/docs/blob/main/content/guides/testcontainers-go-getting-started.md Create the project directory and initialize a new Go module. ```console $ mkdir testcontainers-go-demo $ cd testcontainers-go-demo $ go mod init github.com/testcontainers/testcontainers-go-demo ``` -------------------------------- ### docker agent serve acp usage examples Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md Examples for starting an ACP server over stdio using configuration files or an agent image tag. ```bash # Examples $ docker agent serve acp agent.yaml $ docker agent serve acp ./team.yaml $ docker agent serve acp myorg/agent:tag ``` -------------------------------- ### Sign in with ChatGPT using docker agent setup Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/providers/chatgpt/index.md Launches the setup wizard to authenticate with a ChatGPT account via browser OAuth, storing credentials in ~/.config/cagent/chatgpt-auth.json. ```bash docker agent setup ``` -------------------------------- ### Install apparmor package using apt-get Source: https://github.com/docker/docs/blob/main/content/manuals/engine/release-notes/23.0.md Installs the apparmor package on Debian systems as a manual workaround for containers failing to start due to missing apparmor_parser. ```console apt-get install apparmor ``` -------------------------------- ### Clone the sample to-do app repository Source: https://github.com/docker/docs/blob/main/content/get-started/tutorials/run-an-app.md Clones the getting-started-todo-app repository from GitHub and changes into the project directory. ```console $ git clone https://github.com/docker/getting-started-todo-app $ cd getting-started-todo-app ``` -------------------------------- ### Install Docker RPM package using dnf Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/fedora.md Installs the downloaded Docker RPM package. This creates the docker group but does not start Docker or add users to the group. ```console $ sudo dnf install /path/to/package.rpm ``` -------------------------------- ### Install sample plugin and view daemon logs Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/cli/docs/extend/_index.md Installs a Docker plugin and displays the corresponding dockerd daemon log entry tagged with the plugin ID suffix. ```console $ docker plugin install tiborvass/sample-volume-plugin INFO[0036] Starting... Found 0 volumes on startup plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 ``` -------------------------------- ### Install and start vLLM OpenAI API server Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/providers/local/index.md Installs vLLM using pip and launches the OpenAI-compatible API server using the meta-llama/Llama-3.2-3B-Instruct model on port 8000. ```bash # Install vLLM pip install vllm # Start the server python -m vllm.entrypoints.openai.api_server \ --model meta-llama/Llama-3.2-3B-Instruct \ --port 8000 ``` -------------------------------- ### Start a container (POST /containers/(id)/start) Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.6.md Starts a container with optional host configuration settings such as port bindings, binds, and LxcConf. ```http POST /containers/(id)/start HTTP/1.1 Content-Type: application/json { "Binds":["/tmp:/tmp"], "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}], "ContainerIDFile": "", "Privileged": false, "PortBindings": {"22/tcp": [{"HostIp":"", "HostPort":""}]}, "Links": [], "PublishAllPorts": false } ``` ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` -------------------------------- ### docker agent serve a2a usage examples Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md Examples for starting an A2A server with a YAML config file, a custom listen address, or an agent image tag. ```bash # Examples $ docker agent serve a2a agent.yaml $ docker agent serve a2a agent.yaml --listen 127.0.0.1:9000 $ docker agent serve a2a myorg/agent:tag ``` -------------------------------- ### Install Docker Desktop RPM package using DNF Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/linux/fedora.md Installs the downloaded Docker Desktop RPM package into `/opt/docker-desktop` and executes post-installation setup scripts automatically. ```console $ sudo dnf install ./docker-desktop-x86_64.rpm ``` -------------------------------- ### Start a container via POST /containers/(id or name)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.14.md Starts an existing container using optional host configuration settings such as volume binds, port bindings, and capabilities. ```http POST /containers/e90e34656806/start HTTP/1.1 Content-Type: application/json { "Binds":["/tmp:/tmp"], "Links":["redis3:redis"], "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}], "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] }, "PublishAllPorts":false, "Privileged":false, "Dns": ["8.8.8.8"], "VolumesFrom": ["parent", "other:ro"], "CapAdd": ["NET_ADMIN"], "CapDrop": ["MKNOD"] } ``` ```http HTTP/1.1 204 No Content ``` -------------------------------- ### Install Docker Compose plugin on Ubuntu and Debian Source: https://github.com/docker/docs/blob/main/content/manuals/compose/install/linux.md Updates the apt package index and installs the latest docker-compose-plugin package. Requires Docker repository setup beforehand. ```console $ sudo apt-get update $ sudo apt-get install docker-compose-plugin ``` -------------------------------- ### Dockerfile image input examples Source: https://github.com/docker/docs/blob/main/content/manuals/build/policies/inputs.md Example Dockerfile demonstrating FROM and COPY --from instructions evaluated by image input policies. ```dockerfile FROM alpine:3.19@sha256:abc123... COPY --from=builder:latest /app /app ``` -------------------------------- ### Diagnose and setup Claude Code harness Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/harnesses/index.md Probe harness installation and login state using docker agent doctor, or run interactive harness configuration via docker agent setup. ```bash $ docker agent doctor ./agent.yaml # checks install + login for claude-code harness files $ docker agent setup # pick "Claude Code harness" to be walked through it ``` -------------------------------- ### Start container with POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.8.md Starts a container with optional JSON configuration for volume binds, LXC options, port bindings, and extended privileges. Returns status 204 No Content on success. ```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" }] }, "PublishAllPorts":false, "Privileged":false } ``` ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` -------------------------------- ### Start the frontend service Source: https://github.com/docker/docs/blob/main/content/guides/localstack.md Navigate to the frontend directory, install necessary dependencies, and start the local Vite development server. Once running, access the web UI at http://localhost:5173 to test interactions with LocalStack. ```console $ cd frontend ``` ```console $ npm install ``` ```console $ npm run dev ``` ```console VITE v5.4.2 ready in 110 ms ➜ Local: http://localhost:5173/ ➜ Network: use --host to expose ➜ press h + enter to show help ``` -------------------------------- ### Create project directory Source: https://github.com/docker/docs/blob/main/content/manuals/build/building/multi-platform.md Initializes and navigates into an empty working directory for the Go server application. ```console $ mkdir go-server $ cd go-server ``` -------------------------------- ### Define JupyterLab environment in a Dockerfile Source: https://github.com/docker/docs/blob/main/content/guides/jupyter.md Defines a custom image starting from quay.io/jupyter/base-notebook and installs dependencies with pip so they do not need to be reinstalled in new containers. ```dockerfile # syntax=docker/dockerfile:1 FROM quay.io/jupyter/base-notebook RUN pip install --no-cache-dir matplotlib scikit-learn ``` -------------------------------- ### Start container with docker run Source: https://github.com/docker/docs/blob/main/content/get-started/tutorials/run-an-app.md Runs the container in the background, assigns the name welcome, and maps host port 8080 to container port 80. ```console $ docker run --detach --name welcome --publish 8080:80 docker/welcome-to-docker ``` -------------------------------- ### Generate shell completion scripts Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md Generates autocompletion scripts for bash, zsh, fish, or powershell, with examples for session loading and permanent installation. ```bash $ docker agent completion # Examples # Bash: load for the current session $ source <(docker agent completion bash) # Zsh: install permanently (adjust the path for your $fpath) $ docker agent completion zsh > "${fpath[1]}/_docker-agent" ``` -------------------------------- ### Override environment variable from command line Source: https://github.com/docker/docs/blob/main/content/manuals/compose/how-tos/environment-variables/variable-interpolation.md Override a specific environment variable when starting containers using the -e flag. This example overrides DATABASE_URL. ```console $ docker compose --env-file .env.dev up -e DATABASE_URL=mysql://new_user:new_password@new_db:3306/new_database ``` -------------------------------- ### Configure one-shot setup service with service_completed_successfully Source: https://github.com/docker/docs/blob/main/content/manuals/compose/how-tos/init-containers.md Models startup setup tasks using a peer service with restart: "no" and service_completed_successfully dependency condition. ```yaml services: migrate: image: myapp:latest command: ["./manage.py", "migrate"] restart: "no" app: image: myapp:latest depends_on: migrate: condition: service_completed_successfully ``` -------------------------------- ### GET /v1.22/events Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.22.md Streams real-time events from Docker, including container, image, volume, and network activity. Allows filtering events starting from a specific timestamp. ```APIDOC ## GET /v1.22/events ### Description Get container events from docker, in real time via streaming. ### Method GET ### Endpoint /v1.22/events ### Parameters #### Query Parameters - **since** (string/integer) - Optional - Timestamp to monitor events from. ### Request Example ```http GET /v1.22/events?since=1374067924 ``` ### Response #### Success Response (200 OK) Streamed event messages in real time. #### Response Example ```http HTTP/1.1 200 OK Content-Type: application/json Server: Docker/1.10.0 (linux) Date: Fri, 29 Apr 2016 15:18:06 GMT Transfer-Encoding: chunked ``` ``` -------------------------------- ### Complete TypeScript example in quickstart/run.ts Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes-api/cookbook/create-your-first-sandbox.md Defines the full `createAndRun` function in `quickstart/run.ts` configuring kit launch parameters, timeout signals, and process execution. ```typescript import type { Sandboxes } from '@docker/sandboxes'; export async function createAndRun( client: Sandboxes, kitName: string, args: string[], timeoutMs = 300_000, ) { const signal = AbortSignal.timeout(timeoutMs); const created = await client.kits.launch( kitName, { resources: { cpus: 2, memoryMib: 4096 } }, { timeoutMs, signal }, ); const sandbox = await created.waitUntilRunning({ timeoutMs, signal }); const result = await sandbox.processes.run( { args }, { timeoutMs, signal }, ); return { sandbox, result }; } ``` -------------------------------- ### Uncached apt-get update issue example Source: https://github.com/docker/docs/blob/main/content/manuals/build/building/best-practices.md Demonstrates an anti-pattern where running apt-get update in a separate layer leads to stale cache issues on subsequent installs. ```dockerfile # syntax=docker/dockerfile:1 FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y --no-install-recommends curl ``` -------------------------------- ### Example directory structure for a sandbox kit Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/customize/author/_index.md Demonstrates organizing a kit directory with a paired YAML descriptor, Dockerfile, context documentation, and supporting configuration files. ```text my-kit/ ├── my-kit.yaml ├── my-kit.dockerfile ├── context.md └── files/ └── settings.json ``` -------------------------------- ### Run hello-world container in Linux console Source: https://github.com/docker/docs/blob/main/COMPONENTS.md Example command displayed within a Linux tab panel. ```console $ docker run hello-world ``` -------------------------------- ### GET /info Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.16.md Display system-wide information regarding the Docker daemon installation. Returns container and image counts, storage drivers, memory limits, and kernel details. ```APIDOC ## GET /info ### Description Display system-wide information. ### Method GET ### Endpoint /info ### Request Example ```http GET /info HTTP/1.1 ``` ### Response #### Status Codes - **200** - No error - **500** - Server error #### Response Example ```json { "Containers": 11, "Images": 16, "Driver": "btrfs", "DriverStatus": [[""]], "ExecutionDriver": "native-0.1", "KernelVersion": "3.12.0-1-amd64", "NCPU": 1, "MemTotal": 2099236864, "Name": "prod-server-42", "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", "Debug": false, "NFd": 11, "NGoroutines": 21, "NEventsListener": 0, "InitPath": "/usr/bin/docker", "InitSha1": "", "IndexServerAddress": ["https://index.docker.io/v1/"], "MemoryLimit": true, "SwapLimit": false, "IPv4Forwarding": true, "Labels": ["storage=ssd"], "DockerRootDir": "/var/lib/docker", "OperatingSystem": "Boot2Docker" } ``` ```