### Install Docker Desktop from Windows Command Prompt Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/windows-install.md Use `start /w` for per-user (no admin required) or all-users (run as administrator) installation. ```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 ``` -------------------------------- ### Start Docker Offload v1 with docker offload start Source: https://github.com/docker/docs/blob/main/content/manuals/offload/v1/quickstart.md Run this command in a terminal to start Docker Offload v1. If you belong to multiple organizations with access, you can select a profile; usage is associated with the selected organization. ```console $ docker offload start ``` -------------------------------- ### 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 ``` -------------------------------- ### Run Docker Desktop Installer with PowerShell ArgumentList Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/windows-install.md Use the ArgumentList parameter before any installer flags when invoking the installer from PowerShell. The example runs the installer and waits for completion while accepting the license. ```powershell Start-Process 'Docker Desktop Installer.exe' -Wait -ArgumentList 'install', '--accept-license' ``` -------------------------------- ### 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 ``` -------------------------------- ### Install rclone volume driver plugin Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/volumes.md Run this on the Docker host to install the rclone/docker-volume-rclone plugin. This is the initial setup step before creating volumes with the rclone driver. ```console $ docker plugin install --grant-all-permissions rclone/docker-volume-rclone --alias rclone ``` -------------------------------- ### 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 ``` -------------------------------- ### Start mirroring a DHI repository with docker dhi mirror start Source: https://github.com/docker/docs/blob/main/content/manuals/dhi/how-to/select-enterprise.md Starts mirroring a DHI repository to your organization namespace. Requires DHI CLI authentication using your Docker token. Replace with your organization name. ```console $ docker dhi mirror start --org dhi/python,/dhi-python ``` -------------------------------- ### Start a container which creates a volume using the rclone volume driver Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/volumes.md If the volume driver requires options, you must use the --mount flag to mount the volume, not -v. This example starts an nginx container and creates a volume using the rclone driver. ```console $ docker run -d \ --name rclone-container \ --mount type=volume,volume-driver=rclone,src=rclonevolume,target=/app,volume-opt=type=sftp,volume-opt=path=remote, volume-opt=sftp-host=1.2.3.4,volume-opt=sftp-user=user,volume-opt=-o "sftp-password=$(cat file_containing_password_for_remote_host)" \ nginx:latest ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### Well-formed RUN instruction with apt-get recommendations Source: https://github.com/docker/docs/blob/main/content/manuals/build/building/best-practices.md Demonstrates all apt-get recommendations: combining update and install, version pinning, and cleaning up the apt cache to reduce image size. ```dockerfile RUN apt-get update && apt-get install -y --no-install-recommends \ aufs-tools \ automake \ build-essential \ curl \ dpkg-sig \ libcap-dev \ libsqlite3-dev \ mercurial \ reprepro \ ruby1.9.1 \ ruby1.9.1-dev \ s3cmd=1.1.* \ && rm -rf /var/lib/apt/lists/* ``` -------------------------------- ### 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 ``` -------------------------------- ### Diagnose and set up the Claude Code harness Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/harnesses/index.md If the CLI is not logged in, the `claude` subprocess fails at session start and the agent reports a harness error. Use `docker agent doctor` to check install and login for `claude-code` harness files, and `docker agent setup` to be walked through 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 ``` -------------------------------- ### Run the customized image and verify curl with docker run Source: https://github.com/docker/docs/blob/main/content/manuals/dhi/how-to/select-enterprise.md Run the customized image and check that curl is installed. This confirms the curl package was successfully added to the image. ```console $ docker run --rm /dhi-python:3-alpine3.23_python-with-curl curl --version ``` -------------------------------- ### Example prompt asking the agent to find and run test and lint commands Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/cloud/environment-files.md Sample instruction to give the agent after attaching. It directs the agent to work in the web-app workspace, find test and lint commands in package.json, install dependencies, run checks, fix failures, and ask before changing dependencies. ```text Work in /home/agent/workspace/web-app. Find the test and lint commands in package.json, install the dependencies, and run those checks. Fix any failures and explain your changes. Ask before changing dependencies. ``` -------------------------------- ### Stop a sandbox with sbx stop Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/get-started.md Sandboxes persist after the agent exits, so stopping one lets you resume later. Installed packages, Docker images, and configuration changes are preserved across restarts. ```console sbx stop my-sandbox ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### Build the application's container image with docker build Source: https://github.com/docker/docs/blob/main/content/manuals/agentic-platform/get-started.md The Shell kit includes Docker Engine. Run this from the project directory to build the image tagged welcome-to-docker; the build installs dependencies and compiles the app inside the sandbox. ```console $ docker build -t welcome-to-docker . ``` -------------------------------- ### Build and serve the documentation site with Hugo Source: https://github.com/docker/docs/blob/main/hack/api-docs/README.md Installs Node dependencies and starts the local Hugo server from the repository root. Uses the committed data/api-reference.json without running the generator. ```console $ npm ci $ hugo server ``` -------------------------------- ### 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 ``` -------------------------------- ### Populate a volume using a container with --mount Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/volumes.md Starts an `nginx` container and populates the new volume `nginx-vol` with the contents of the container's `/usr/share/nginx/html` directory. The `--mount` and `-v` examples have the same end result. ```console $ docker run -d \ --name=nginxtest \ --mount source=nginx-vol,destination=/usr/share/nginx/html \ nginx:latest ``` -------------------------------- ### Start Docker service Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/debian.md Manually starts the Docker service if it is not running. ```console $ sudo systemctl start docker ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 Desktop from PowerShell Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/windows-install.md Use `Start-Process` with `-Wait` for per-user (no admin required) or all-users (run as administrator) installation. ```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 Docker Engine package with dnf Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/centos.md Install the downloaded .rpm file using the dnf package manager. Docker is installed but not started, and no users are added to the docker 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 ``` -------------------------------- ### Set up rootless Docker using dockerd-rootless-setuptool.sh Source: https://github.com/docker/docs/blob/main/content/manuals/engine/security/rootless/_index.md Runs the rootless setup tool as a non-root user when Docker is installed via RPM/DEB packages. Configures the systemd user service and sets the CLI context to rootless. ```console $ dockerd-rootless-setuptool.sh install [INFO] Creating /home/testuser/.config/systemd/user/docker.service ... [INFO] Installed docker.service successfully. [INFO] To control docker.service, run: `systemctl --user (start|stop|restart) docker.service` [INFO] To run docker.service on system startup, run: `sudo loginctl enable-linger testuser` [INFO] Creating CLI context "rootless" Successfully created context "rootless" [INFO] Using CLI context "rootless" Current context is now "rootless" [INFO] Make sure the following environment variable(s) are set (or add them to ~/.bashrc): export PATH=/usr/bin:$PATH [INFO] Some applications may require the following environment variable too: export DOCKER_HOST=unix:///run/user/1000/docker.sock ``` -------------------------------- ### 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 ``` -------------------------------- ### Remove a sandbox with sbx rm Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/get-started.md Use to reclaim disk space when done with a sandbox. Removing deletes everything inside it, including installed packages, Docker images, and the in-sandbox Git clone if clone mode was used; host working tree files are unaffected. ```console sbx rm my-sandbox ``` -------------------------------- ### Install the latest Docker Engine version Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/centos.md Install the latest version of Docker Engine, CLI, containerd, and plugins. This command does not start the Docker service. ```console $ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` -------------------------------- ### 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 ``` -------------------------------- ### Start Docker Engine Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/centos.md Enable and start the Docker systemd service to run automatically on boot. ```console $ sudo systemctl enable --now docker ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### Use Ollama as provider with --provider ollama Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/configuration/models.md Install and start Ollama on your host, then select it with --provider. Docker Sandboxes connects to Ollama at localhost:11434 and does not install, start, or manage the Ollama process. ```console sbx run --model gemma4 --provider ollama claude ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### Start Docker Desktop via systemctl Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/linux/archlinux.md Use this command to start the Docker Desktop service from the terminal. ```console $ systemctl --user start docker-desktop ``` -------------------------------- ### Set up Docker apt repository Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/raspberry-pi-os.md Configure the Docker apt repository by adding the official GPG key and the repository source to your system. ```bash # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL {{% param "download-url-base" %}}/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] {{% param "download-url-base" %}} \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update ``` -------------------------------- ### Ask Claude Code to clone and review a sample project Source: https://github.com/docker/docs/blob/main/content/manuals/agentic-platform/get-started.md Use this prompt in the Claude Code terminal to clone the public welcome-to-docker repository into /home/agent/workspace/project and review it. The agent reads the source, package.json, and Dockerfile without modifying the app or installing dependencies, then writes /home/agent/workspace/review.md and summarizes findings in the conversation. ```text Clone https://github.com/docker/welcome-to-docker.git into /home/agent/workspace/project, then review the application. Read the source, package.json, and Dockerfile. Don't modify the application or install dependencies. Write /home/agent/workspace/review.md with: - A short explanation of what the application does. - The commands defined in package.json for running and building it. - An explanation of how the Dockerfile builds and serves the application. - One small improvement you'd recommend, with the relevant file path. Base the review on the files you read. Don't claim to have run the application. Summarize your findings in your response. ``` -------------------------------- ### Create and inspect network to verify default options Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/cli/docs/reference/dockerd.md Demonstrates creating a new network and inspecting its options to confirm default network settings are applied. Changing daemon default configuration does not update existing networks. ```console $ docker network create mynet $ docker network inspect mynet --format "{{json .Options}}" {"com.docker.network.bridge.host_binding_ipv4":"127.0.0.1","com.docker.network.driver.mtu":"1234"} ``` -------------------------------- ### Run a container in the cloud sandbox with docker run Source: https://github.com/docker/docs/blob/main/content/manuals/offload/quickstart.md Runs the hello-world container to verify Docker Offload is working. The container runs in the cloud sandbox and streams output to your terminal; success shows Hello from Docker!. ```console $ docker run --rm hello-world ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### Start a container with POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.7.md Starts the specified container ID. Binds must reference volumes defined during container creation. ```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 } ``` ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` -------------------------------- ### Install and register QEMU using tonistiigi/binfmt Source: https://github.com/docker/docs/blob/main/content/manuals/build/building/multi-platform.md Installs QEMU binaries and registers non-native executable types on the host OS using binfmt_misc. Requires Linux kernel 4.8 or later and binfmt-support 2.1.7 or later. ```console $ docker run --privileged --rm tonistiigi/binfmt --install all ``` -------------------------------- ### 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 ``` -------------------------------- ### POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.3.md Start a container with optional host configuration bindings. ```APIDOC ## POST /containers/(id)/start ### Description Start the container `id` ### Method POST ### Endpoint `/containers/(id)/start` ### Parameters #### Path Parameters - **id** (string) - Required - Container ID #### Request Body - **hostConfig** (object) - Optional - The container's host configuration ### Request Example ```http POST /containers/4fa6e0f0c678/start HTTP/1.1 Content-Type: application/json { "Binds":["/tmp:/tmp"] } ``` ### Response #### Status Codes - **200** – no error - **404** – no such container - **500** – server error #### Response Example ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` ``` -------------------------------- ### Get DHI image details with docker dhi catalog get Source: https://github.com/docker/docs/blob/main/content/manuals/dhi/how-to/select-enterprise.md Retrieves details for a specific DHI repository. Requires Docker Desktop 4.65 or later and a DHI Select, Enterprise, or trial subscription. ```console $ docker dhi catalog get python ``` -------------------------------- ### View the sample application directory structure Source: https://github.com/docker/docs/blob/main/content/guides/deno.md Shows the expected files and folders contained within the cloned deno-docker repository. ```text ├── deno-docker/ │ ├── compose.yml │ ├── Dockerfile │ ├── LICENSE │ ├── server.ts │ └── README.md ``` -------------------------------- ### Read kit install and startup logs with sbx exec Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/troubleshooting.md Use when `sbx create` or `sbx run` shows ✗ on a kit's install command or warns that a startup command failed. `` is the install command's position in the kit's `install` list, starting at 0. ```console $ sbx exec cat /var/log/sbx-kits//install-.log $ sbx exec cat /var/log/sbx-kit-startup.log ``` -------------------------------- ### Initialize Compose SDK service and start a project Source: https://github.com/docker/docs/blob/main/content/manuals/compose/compose-sdk.md Initializes a Docker CLI client and Compose service instance, loads a project from compose.yaml, and starts the services using Up(). ```go package main import ( "context" "log" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/flags" "github.com/docker/compose/v5/pkg/api" "github.com/docker/compose/v5/pkg/compose" ) func main() { ctx := context.Background() dockerCLI, err := command.NewDockerCli() if err != nil { log.Fatalf("Failed to create docker CLI: %v", err) } err = dockerCLI.Initialize(&flags.ClientOptions{}) if err != nil { log.Fatalf("Failed to initialize docker CLI: %v", err) } // Create a new Compose service instance service, err := compose.NewComposeService(dockerCLI) if err != nil { log.Fatalf("Failed to create compose service: %v", err) } // Load the Compose project from a compose file project, err := service.LoadProject(ctx, api.ProjectLoadOptionsRestore{ ConfigPaths: []string{"compose.yaml"}, ProjectName: "my-app", }) if err != nil { log.Fatalf("Failed to load project: %v", err) } // Start the services defined in the Compose file err = service.Up(ctx, project, api.UpOptions{ Create: api.CreateOptions{}, Start: api.StartOptions{}, }) if err != nil { log.Fatalf("Failed to start services: %v", err) } log.Printf("Successfully started project: %s", project.Name) } ``` -------------------------------- ### Install and start the vLLM OpenAI-compatible server Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/providers/local/index.md Install vLLM with pip, then launch its OpenAI-compatible API server on port 8000 serving the meta-llama/Llama-3.2-3B-Instruct model. ```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 with POST /containers/(id or name)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.15.md Starts a container using runtime configuration parameters including volume binds, port mappings, and restart policies. Returns HTTP status 204 on success, 304 if already started, or 404 if the container does not exist. ```http POST /containers/e90e34656806/start HTTP/1.1 Content-Type: application/json { "Binds": ["/tmp:/tmp"], "Links": ["redis3:redis"], "LxcConf": {"lxc.utsname":"docker"}, "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, "PublishAllPorts": false, "Privileged": false, "Dns": ["8.8.8.8"], "DnsSearch": [""], "VolumesFrom": ["parent", "other:ro"], "CapAdd": ["NET_ADMIN"], "CapDrop": ["MKNOD"], "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, "NetworkMode": "bridge", "Devices": [] } ``` ```http HTTP/1.1 204 No Content ``` -------------------------------- ### Start container via POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.13.md Starts an existing container using host configurations such as port bindings, volume mounts, DNS settings, and link configurations. ```http POST /containers/(id)/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"] } ``` ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` -------------------------------- ### Incorrect: separate apt-get update and install Source: https://github.com/docker/docs/blob/main/content/manuals/build/building/best-practices.md Using `apt-get update` alone in a `RUN` statement causes caching issues and subsequent `apt-get install` instructions to fail. This example shows the problematic pattern. ```dockerfile # syntax=docker/dockerfile:1 FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y --no-install-recommends curl ``` -------------------------------- ### Start container via POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.10.md Starts the specified container with optional host configuration settings such as port bindings, binds, and DNS. ```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, "Dns": ["8.8.8.8"], "VolumesFrom": ["parent", "other:ro"] } ``` ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` -------------------------------- ### Example configure agent progress output for a kit Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/customize/author/debug.md Shows the rows printed during sbx create and sbx run for the example kit, including the install log location and startup log path. ```text AGENT running 1 install command ✓ Install ripgrep (kit=my-kit, user=0, 12.4s) view install logs: ls /var/log/sbx-kits registering 1 startup command, run on every container start ○ Record the ripgrep version (kit=my-kit, user=agent) view startup log: cat /var/log/sbx-kit-startup.log ``` -------------------------------- ### Start a container with a volume using --mount Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/volumes.md Runs a container and mounts the volume myvol2 into /app using the --mount flag. Docker creates the volume if it doesn't exist. ```console $ docker run -d \ --name devtest \ --mount source=myvol2,target=/app \ nginx:latest ``` -------------------------------- ### Disable analytics from the command line with DISABLEANALYTICS Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/enterprise/enterprise-deployment/msi-install-and-configure.md Use the `DISABLEANALYTICS` property when installing Docker Desktop from the command line to opt out of anonymous installation usage statistics. The example runs msiexec with verbose logging to msi.log. ```powershell msiexec /i "DockerDesktop.msi" /L*V ".\msi.log" DISABLEANALYTICS=1 ``` -------------------------------- ### Verify Docker installation with hello-world Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/binaries.md Run the hello-world image to verify the installation, replacing with the address of the machine running the Docker daemon. ```console $ sudo docker -H run hello-world ``` -------------------------------- ### Model configuration examples by provider Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/configuration/models/index.md Example model configurations for OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, and Docker Model Runner. For detailed provider setup, see the Model Providers section. ```yaml models: # OpenAI gpt: provider: openai model: gpt-5 # Anthropic claude: provider: anthropic model: claude-sonnet-4-5 max_tokens: 64000 # Google Gemini gemini: provider: google model: gemini-3.5-flash temperature: 0.5 # AWS Bedrock bedrock: provider: amazon-bedrock model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 provider_opts: region: us-east-1 # OpenRouter openrouter: provider: openrouter model: meta-llama/llama-3.3-70b-instruct # Docker Model Runner (local) local: provider: dmr model: ai/qwen3 max_tokens: 8192 ``` -------------------------------- ### Verify Docker installation with hello-world Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/binaries.md Run the hello-world image to confirm that Docker is installed and functioning correctly. ```console $ sudo docker run hello-world ``` -------------------------------- ### Start container with a bind mount using --mount Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/bind-mounts.md Binds the host target/ directory to /app in the container using the --mount parameter. Run this command from within the source directory so $(pwd) resolves properly. ```console $ docker run -d \ -it \ --name devtest \ --mount type=bind,source="$(pwd)"/target,target=/app \ nginx:latest ``` -------------------------------- ### Run the generated agent.yaml Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/getting-started/quickstart/index.md Runs the config file created by the interactive builder, for example agent.yaml. ```bash $ docker agent run agent.yaml ``` -------------------------------- ### Create a sandbox with Claude Code installed Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/integrations/orca.md Orca only offers agents it finds installed on the host it connects to, so create the sandbox with the agent you plan to drive. This example creates a sandbox named demo with Claude Code. ```console $ sbx create --name demo claude . ``` -------------------------------- ### Run the local mistral-vibe kit against a project with sbx run Source: https://github.com/docker/docs/blob/main/content/guides/mistral-vibe-sandbox.md Launch the local kit against your project; replace ./my-project with the workspace Vibe should edit. --name gives the sandbox a predictable name, and the project path is mounted read-write so Vibe's changes appear on your host. ```console $ sbx run --name mistral-vibe ./mistral-vibe ./my-project ``` -------------------------------- ### 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 ``` -------------------------------- ### POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.6.md Start a container with optional host configuration settings such as port bindings and volume mounts. ```APIDOC ## POST /containers/(id)/start ### Description Start the container `id` ### Method POST ### Endpoint `/containers/(id)/start` ### Parameters #### Path Parameters - **id** (string) - Required - Container ID #### Request Body - **hostConfig** (object) - Optional - the container's host configuration ### Request Example ```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 } ``` ### Response #### Success Response (204) Status Codes: - **204** – no error - **404** – no such container - **500** – server error #### Response Example ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` ``` -------------------------------- ### 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 ``` -------------------------------- ### Verify Docker installation with hello-world Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/binaries.md Run the hello-world:nanoserver image to confirm that the Docker daemon is functioning correctly. ```powershell PS C:\> &$Env:ProgramFiles\Docker\docker run hello-world:nanoserver ``` -------------------------------- ### Start an exec instance with POST /exec/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.15.md Starts a previously configured exec instance interactively or detached. Returns a raw stream on success or HTTP 404 if the exec instance is not found. ```http POST /exec/e90e34656806/start HTTP/1.1 Content-Type: application/json { "Detach": false, "Tty": false, } ``` ```http HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} ``` -------------------------------- ### Run the container and publish port 3000 with docker run Source: https://github.com/docker/docs/blob/main/content/manuals/agentic-platform/get-started.md After the build finishes, start a detached container named welcome-to-docker and publish its port 3000 to the host. Use the Connect panel to open port 3000 and preview the app. ```console $ docker run -d --name welcome-to-docker -p 3000:3000 welcome-to-docker ``` -------------------------------- ### Run a single command in the cloud with --cloud Source: https://github.com/docker/docs/blob/main/content/manuals/offload/quickstart.md Sends a build and run command to the cloud without running docker offload create first. The --cloud flag leaves your context unchanged and creates a sandbox if one doesn't exist. ```console $ docker --cloud build . $ docker --cloud run --rm hello-world ``` -------------------------------- ### Sign in to Docker Hub with docker login Source: https://github.com/docker/docs/blob/main/content/manuals/dhi/how-to/select-enterprise.md Authenticate to Docker Hub before pulling a customized image from your organization namespace. ```console $ docker login ``` -------------------------------- ### 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 ``` ``` -------------------------------- ### Build and tag a Docker image with example username Source: https://github.com/docker/docs/blob/main/content/get-started/docker-concepts/building-images/build-tag-and-publish-an-image.md Example build command demonstrating tagging the image with the specific username mobywhale. ```console $ docker build -t mobywhale/concepts-build-image-demo . ``` -------------------------------- ### docker agent plans subcommand examples Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md Examples of using `docker agent plans` subcommands: list, create, get, update, status, export, and delete. Includes usage of `--json`, `--file`, `--expected-version`, and `--force` flags. ```bash # Examples $ docker agent plans list $ docker agent plans list --json | jq '.plans[].name' $ docker agent plans create release --file ./plan.md --title "Release plan" --status draft $ cat plan.md | docker agent plans create release --file - $ docker agent plans get release > plan.md # content only; metadata on stderr $ docker agent plans update release --file ./plan.md --expected-version 1 $ docker agent plans status release done --expected-version 2 $ docker agent plans export release --output ./plan.md $ docker agent plans export release --output ./plan.md --force # replace an existing file $ docker agent plans delete release --expected-version 3 $ docker agent plans delete scratch --force ``` -------------------------------- ### 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" } ``` ``` -------------------------------- ### Check Docker Model Runner status Source: https://github.com/docker/docs/blob/main/_vendor/github.com/docker/docker-agent/docs/getting-started/set-up-a-model/index.md Verify that Docker Model Runner is installed and responding. If the command is missing or fails, follow the Model Runner get-started guide. ```bash $ docker model status ``` -------------------------------- ### docker run --mount type=volume example with ro and volume-subpath Source: https://github.com/docker/docs/blob/main/content/manuals/engine/storage/volumes.md Example using --mount with a named volume, read-only option, and volume subdirectory. ```console $ docker run --mount type=volume,src=myvolume,dst=/data,ro,volume-subpath=/foo ``` -------------------------------- ### Launch an agent with sbx run Source: https://github.com/docker/docs/blob/main/content/manuals/ai/sandboxes/get-started.md Run from a project directory to start an agent in a sandbox; the current directory is mounted read-write. In an interactive terminal you may be prompted to choose a preset if the global network policy isn't initialized. Replace `claude` with your desired agent. ```console $ cd ~/my-project $ sbx run --name my-sandbox claude ``` -------------------------------- ### POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.13.md Starts the specified container with optional host configuration settings including volume bindings, port bindings, and DNS configuration. ```APIDOC ## POST /containers/(id)/start ### Description Start the container `id`. ### Method POST ### Endpoint `/containers/(id)/start` ### Parameters #### Path Parameters - **id** (string) - Required - Container ID or name #### Request Body - **hostConfig** (object) - Optional - The container's host configuration ### Request Example ```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"] } ``` ### Response #### Success Response (204) - No Content #### Status Codes - **204** - no error - **304** - container already started - **404** - no such container - **500** - server error ``` -------------------------------- ### POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.10.md Starts the specified container with optional host configuration settings. ```APIDOC ## POST /containers/(id)/start ### Description Start the container `id`. ### Method POST ### Endpoint `/containers/(id)/start` ### Parameters #### Path Parameters - **id** (string) - Required - Container ID #### Request Body - **hostConfig** (object) - Optional - The container's host configuration (e.g., `Binds`, `LxcConf`, `PortBindings`, `PublishAllPorts`, `Privileged`, `Dns`, `VolumesFrom`). ### Request Example ```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, "Dns": ["8.8.8.8"], "VolumesFrom": ["parent", "other:ro"] } ``` ### Response #### Success Response (204) - **Content-Type**: `text/plain` #### Response Example ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` ### Status Codes - **204** – no error - **404** – no such container - **500** – server error ``` -------------------------------- ### Fix iptables startup failure Source: https://github.com/docker/docs/blob/main/content/manuals/engine/install/fedora.md If the Docker service fails to start due to missing iptables, point the command to iptables-nft and restart the service. ```console $ sudo alternatives --set iptables /usr/bin/iptables-nft $ sudo systemctl restart docker ``` -------------------------------- ### POST /containers/(id)/start Source: https://github.com/docker/docs/blob/main/_vendor/github.com/moby/moby/api/docs/v1.12.md Start an existing container by ID or name with optional host configuration settings. ```APIDOC ## POST /containers/(id)/start ### Description Start the container `id`. ### Method POST ### Endpoint `/containers/(id)/start` ### Parameters #### Path Parameters - **id** (string) - Required - Container ID or name #### Request Body - **hostConfig** (object) - Optional - The container's host configuration ### Request Example ```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"] } ``` ### Response #### Success Response (204) - No Content #### Response Example ```http HTTP/1.1 204 No Content Content-Type: text/plain ``` #### Status Codes - **204** - no error - **404** - no such container - **500** - server error ``` -------------------------------- ### Enable Docker Desktop on sign in via systemctl Source: https://github.com/docker/docs/blob/main/content/manuals/desktop/setup/install/linux/archlinux.md Configure Docker Desktop to start automatically when you sign in to your computer using the terminal. ```console $ systemctl --user enable docker-desktop ``` -------------------------------- ### Run hello-world container in Windows PowerShell Source: https://github.com/docker/docs/blob/main/COMPONENTS.md Example command displayed within a Windows tab panel. ```powershell docker run hello-world ``` -------------------------------- ### Apply the DHI customization with docker dhi customization create Source: https://github.com/docker/docs/blob/main/content/manuals/dhi/how-to/select-enterprise.md Apply the customization defined in my-customization.yaml. Replace with your organization name. ```console $ docker dhi customization create --org my-customization.yaml ```